Closed Bug 1389848 Opened 4 years ago Closed 4 years ago
Service Instantiated By Contract ID should return false rather than throw when component isn't instantiated
Bug 1389848: Make isServiceInstantiated*() return false rather than throw for uninstantiated services.
59 bytes, text/x-review-board-request
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+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/e19453003208 Make isServiceInstantiated*() return false rather than throw for uninstantiated services. r=ehsan
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.