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

RESOLVED FIXED in Firefox 57

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Paolo, Assigned: Paolo)

Tracking

(Blocks 1 bug)

unspecified
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox57 fixed)

Details

(Whiteboard: [qf:p1])

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
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 hidden (mozreview-request)

Comment 3

2 years ago
mozreview-review
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+

Comment 4

2 years ago
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]

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/c5f62e5b5655
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.