Closed Bug 1391576 Opened 7 years ago Closed 7 years ago

Stop doing main-thread I/O in FileUtils.getFile for the most common case

Categories

(Toolkit :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Performance Impact high
Tracking Status
firefox57 --- fixed

People

(Reporter: Paolo, Assigned: Paolo)

References

Details

Attachments

(1 file)

There are a few cases where this method is still used with unnecessary I/O:

http://searchfox.org/mozilla-central/search?q=FileUtils.getFile&path=

Bug 920187 is on file to migrate the callers, but for the moment we can get an easy win by optimizing the function. Looking at the production code above, there shouldn't be cases where the directory doesn't exist if we're not asking for a subdirectory.

I've looked at the callers of FileUtils.getDir also, but they seem to be generally well-behaved:

http://searchfox.org/mozilla-central/search?q=FileUtils.getDir&path=

I'll start a tryserver build to see if any of the test code relies on the creation of the base directory.
Comment on attachment 8898716 [details]
Bug 1391576 - Stop doing main-thread I/O in FileUtils.getFile for the most common case.

https://reviewboard.mozilla.org/r/170122/#review175396

r=me if tests still pass.
Attachment #8898716 - Flags: review?(kmaglione+bmo) → review+
Pushed by paolo.mozmail@amadzone.org:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c5f62e5b5655
Stop doing main-thread I/O in FileUtils.getFile for the most common case. r=kmag
Whiteboard: [qf] → [qf:p1]
https://hg.mozilla.org/mozilla-central/rev/c5f62e5b5655
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Performance Impact: --- → P1
Whiteboard: [qf:p1]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: