mozilla::services

I landed the mozilla::services bug around the same time as Gavin announced the Services.jsm equivalent. Services.jsm came a pleasant surprise to me, it’s nice to have API symmetry.

mozilla::services namespace provides a fast C++ way to refer to common services. This replaces a myriad layers of indirection that happened in the XPCOM GetService() call. Too much generality hurts.

So far I only replaced the common IOService getters. URL objects are 30% less slow to create now. A contributor, Mitchell Field, has volunteered to switch over a huge amount of other common services in bug 560095. That rocks.

Comments are closed.