Closed
Bug 724207
Opened 12 years ago
Closed 12 years ago
Save 15-20ms on startup from unused file attributes fetch when opening files
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: bbondy, Assigned: bbondy)
References
Details
Attachments
(1 file, 2 obsolete files)
850 bytes,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
nsLocalFile::OpenNSPRFileDesc is called 311 times during startup, this takes 20-30ms of startup time. We currently call ResolveaAndStat before opening the file, the purpose is just to get the resolved path though. There are 311 extra unused GetFileAttributeEx calls because of this. We should instead use the newer Resolve() method which takes almost no time to run. These results were obtained by a small profiler I'm using which is based on QueryPerformanceCounter and QueryPerformanceFrequency.
Attachment #594394 -
Flags: review?(benjamin)
Comment 1•12 years ago
|
||
Comment on attachment 594394 [details] [diff] [review] Patch v1. >- nsresult rv = ResolveAndStat(); >+ nsresult rv = Resolve(); Aha, well there's one of them ;-) > if (NS_FAILED(rv) && rv != NS_ERROR_FILE_NOT_FOUND) I don't think Resolve() ever returns this, because it doesn't stat. Alternatively, test mResolveDirty and if it's true then Resolve() failed.
Assignee | ||
Comment 2•12 years ago
|
||
> I don't think Resolve() ever returns this, because it doesn't stat.
> Alternatively, test mResolveDirty and if it's true then Resolve() failed.
I think the check is only really needed to save time on failure conditions, but I think you're right that it should be adjusted. I'll go with testing mResolveDirty
Assignee | ||
Comment 3•12 years ago
|
||
bsmedberg, I'm just going to r? Neil on this since he's already looked at it. Let me know if you need to sr it though.
> I don't think Resolve() ever returns this, because it doesn't stat.
> Alternatively, test mResolveDirty and if it's true then Resolve() failed.
On second thought, to keep the code path the same we should just remove the
`&& rv != NS_ERROR_FILE_NOT_FOUND)`.
Attachment #594394 -
Attachment is obsolete: true
Attachment #594394 -
Flags: review?(benjamin)
Attachment #595018 -
Flags: review?(neil)
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #595018 -
Attachment is obsolete: true
Attachment #595018 -
Flags: review?(neil)
Attachment #595019 -
Flags: review?(neil)
Updated•12 years ago
|
Attachment #595019 -
Flags: review?(neil) → review+
Assignee | ||
Comment 5•12 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/f4a4146c5683
Target Milestone: --- → mozilla13
Comment 6•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f4a4146c5683 \o/
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•