Closed Bug 1389848 Opened 4 years ago Closed 4 years ago

isServiceInstantiatedByContractID should return false rather than throw when component isn't instantiated

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qf:p3])

Attachments

(1 file)

We spend several ms at startup constructing exception objects for startupRecorder.js ahen it checks for uninstantiated services. This isn't an issue for release builds, but it does add extra overhead and GC pressure for nightly talos runs, and ordinary nightly users, that we wouldn't see on release. Which means it gives us a bad picture of what's going on for normal users.
Comment on attachment 8896658 [details]
Bug 1389848: Make isServiceInstantiated*() return false rather than throw for uninstantiated services.

https://reviewboard.mozilla.org/r/167952/#review173466
Attachment #8896658 - Flags: review?(ehsan) → review+
Whiteboard: [qf] → [qf:p3]
Pushed by maglione.k@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e19453003208
Make isServiceInstantiated*() return false rather than throw for uninstantiated services. r=ehsan
https://hg.mozilla.org/mozilla-central/rev/e19453003208
https://hg.mozilla.org/mozilla-central/rev/1952f907b15b
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
If we wanted to completely avoid the startupRecorder overhead related to listing services, we should add a native method returning the list of already instantiated services, instead of having JS code iterating through all the registered contract ids. I didn't bother doing it at the time because it was nightly-only code. But thanks for improving it :-)
You need to log in before you can comment on or make changes to this bug.