Closed Bug 470865 Opened 16 years ago Closed 16 years ago

Can GetService() be made faster?

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: taras.mozilla, Unassigned)

References

Details

Attachments

(1 file)

bsmedberg informed me that caching results of code like Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties) is considered bad practice. However according to my measurements getService() takes > 0.3ms per invocation on N810(down from 0.6ms once bug 470859 is landed). Seems that calling GetService from C++ is fast, but when called from JS the overhead of calling GetService is 10x greater that the call itself.
Attached file oprofile dot graph
This is a profile of calling getService() in a loop.
Blocks: 459117
When built with --with-kuser getService() overhead on n810 is similar to other xpconnect calls: 0.2ms
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: