Closed Bug 73214 Opened 24 years ago Closed 24 years ago

filesystem datasource spends half of its time in FileSystemDataSource::isDirURI()

Categories

(Core Graveyard :: RDF, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.3

People

(Reporter: waterson, Assigned: jtaylor)

References

Details

(Keywords: perf)

Attachments

(4 files)

I was a bit disappointed in the performance of the RDF outliner, so I profiled it on a hacked version of directory.xul, which I'll attach to the bug. (Replace xpfe/components/directory/directory.xul with that version, and rebuild in your xpfe/components dir.) It turns out the *half* the time spent scrolling around is spent in FileSystemDataSource::isDirURI(). Looking at isDirURI(), - 1/3 of the time is spent in NS_NewURI(), constructing a file: URL - 1/3 of the time is spent in nsLocalFile::IsDirectory(), which is all ends up in PR_GetFileInfo64(). - 1/6 of the time is spent in nsStdURL::GetFile(). - 1/6 of the time is spent destroying all these wonderful XPCOM objects that we've created to test if something is a directory. I remember rjc complaining about how bad performance got when he converted the filesystem datasource to nsIFile from nsFileSpec. dougt always said it was rjc's fault, and mumbled about how rjc was doing stuff wrong. Regardless, this sucks. kandrot: you are nsIFile whipping boy these days. Make it better!
Keywords: mozilla0.9, perf
The GetFileInfo64 is going to be required for the stat. I believe that this does more work that just a vanilla stat(). I guess we could optimize it so that only the required information is pulled out for the isExists, isDir, isFile, ect. Conrad and I have been sitting on a patch for some times now that should help out this problem. kandrot, please updating it and check it in. (56354) r=dougt. Waterson, please sr so that we can get this in asap. I will attached a patch that will shave a 1/3 of the time off but is dependant on implementing SetURL on the nsIFile (see above).
Target Milestone: --- → mozilla0.9
Nice. I suspect we could even improve on this a bit by just making an nsILocalFile member variable that we use over and over for the purpose of converting paths. (It's not like this code is threadsafe.) Adding dependency to bug 56354.
Depends on: 56354
Well, since this patch calls a function that is not yet implemented, I can not see checking it in yet. The bug this depends on is marked 1.0, so I am updating this to be the same.
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9 → mozilla1.0
kandrot, there is a patch in the other bug. Lets get this fixed! If you can't, please reassign to me.
Target Milestone: mozilla1.0 → ---
Yes, there is a patch in this bug, but it calls a function that is not implemented. Based on this, I would assume that it would not work. It is all yours to check in, if you believe that it works.
Assignee: kandrot → dougt
Status: ASSIGNED → NEW
Target Milestone: --- → mozilla0.9.2
Assignee: dougt → gagan
Whiteboard: intern?
.
Priority: -- → P3
->jtaylor
Assignee: gagan → jtaylor
Whiteboard: intern?
John, I think that adamlock is going to make this really easy for you. He has a patch in 53654 which will allow you to directly call SetURL/GetURL on a nsIFile.
My patch is just for GetURL. Conrad implemented SetURL in his more substantial patch attached to bug 53654.
Sorry about the double attachments. Doug, can you review the patch?
Status: NEW → ASSIGNED
assuming that this has been tested xp, sr=dougt.
retargeting.
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
tever is not RDF QA anymore
QA Contact: tever → nobody
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: