Closed Bug 514407 Opened 15 years ago Closed 15 years ago

Make cache file writes asynchronous

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.7a1

People

(Reporter: rflint, Assigned: rflint)

Details

(Keywords: perf, Whiteboard: [ts][TSnap])

Attachments

(1 file)

Attached patch PatchSplinter Review
Down with synchronous non-critical IO during startup!

The current sync implementation can also result in Fun Times on slow media after managing engines or installing new ones since we write the full file out every time we invalidate the cache.
Attachment #398369 - Flags: review?(sdwilsh)
Whiteboard: [ts][TSnap]
Comment on attachment 398369 [details] [diff] [review]
Patch

http://reviews.visophyte.org/r/398369/

on file: toolkit/components/search/nsSearchService.js line 224
> __defineGetter__("NetUtil", function() {
>   delete this.NetUtil;
>   Components.utils.import("resource://gre/modules/NetUtil.jsm");
>   return NetUtil;
> });

Use XPCOMUtils.defineLazyGetter please.


on file: toolkit/components/search/nsSearchService.js line 825
>   var templateURI = NetUtil.newURI(aTemplate);

:)

r=sdwilsh
Attachment #398369 - Flags: review?(sdwilsh) → review+
Comment on attachment 398369 [details] [diff] [review]
Patch

>diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js

>+      NetUtil.asyncCopy(data, ostream, function(rv) {
>+        if (!Components.isSuccessCode(rv))
>+          throw Components.Exception("failure during asyncCopy", rv);

LOG here, as well?
http://hg.mozilla.org/mozilla-central/rev/c65c4fbf96fd

(In reply to comment #1)
> Use XPCOMUtils.defineLazyGetter please.

The search service doesn't use/import XPCOMUtils and I don't want to take the import hit until we have more stuff using it (bug 386473) - but noted!
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Flags: in-litmus-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a1
http://hg.mozilla.org/mozilla-central/rev/7c7654971790

s/NetUtil.newURI/makeURI/ due to throw-happiness - it'd be nice to have it return null instead.
Verified fixed based on check-in and follow-up fix.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: