Re: PSA: Please use ChromeUtils.generateQI for JS QueryInterface methods
Great! :) On Fri, May 18, 2018 at 2:58 PM Kris Maglione wrote: > Already done. :) https://bugzil.la/1460092 > > On Fri, May 18, 2018 at 02:48:20PM -0400, Jared Wein wrote: > >Have you looked in to adding an eslint rule for this? The eslint rule[1] > >that recommends usage of ChromeUtils.defineModuleGetter instead of > >XPCOMUtils.defineLazyModuleGetter has been very useful. > > > >[1] > > > https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-chromeutils-import.js#2 > > > >Thanks, > >Jared > > > > > >On Tue, May 8, 2018 at 3:26 PM Kris Maglione > wrote: > > > >> Bug 1456035 added a ChromeUtils.generateQI helper to create > >> QueryInterface methods for JS objects. The QueryInterface methods > >> generated by this function are highly optimized, and have a fast path > >> for calls from XPConnect. > >> > >> Which is to say, please use this method rather than manually writing > >> your QueryInterface functions, or using XPCOMUtils.generateQI. > >> QueryInterface methods tend to be very hot code, and all of the extra > >> overhead from JS implementations adds up fast. > >> > >> -Kris > >> ___ > >> firefox-dev mailing list > >> firefox-...@mozilla.org > >> https://mail.mozilla.org/listinfo/firefox-dev > >> > > -- > Kris Maglione > Senior Firefox Add-ons Engineer > Mozilla Corporation > > The first principle is that you must not fool yourself — and you are > the easiest person to fool. > --Richard Feynman > > ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: PSA: Please use ChromeUtils.generateQI for JS QueryInterface methods
Already done. :) https://bugzil.la/1460092 On Fri, May 18, 2018 at 02:48:20PM -0400, Jared Wein wrote: Have you looked in to adding an eslint rule for this? The eslint rule[1] that recommends usage of ChromeUtils.defineModuleGetter instead of XPCOMUtils.defineLazyModuleGetter has been very useful. [1] https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-chromeutils-import.js#2 Thanks, Jared On Tue, May 8, 2018 at 3:26 PM Kris Maglione wrote: Bug 1456035 added a ChromeUtils.generateQI helper to create QueryInterface methods for JS objects. The QueryInterface methods generated by this function are highly optimized, and have a fast path for calls from XPConnect. Which is to say, please use this method rather than manually writing your QueryInterface functions, or using XPCOMUtils.generateQI. QueryInterface methods tend to be very hot code, and all of the extra overhead from JS implementations adds up fast. -Kris ___ firefox-dev mailing list firefox-...@mozilla.org https://mail.mozilla.org/listinfo/firefox-dev -- Kris Maglione Senior Firefox Add-ons Engineer Mozilla Corporation The first principle is that you must not fool yourself — and you are the easiest person to fool. --Richard Feynman ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: PSA: Please use ChromeUtils.generateQI for JS QueryInterface methods
Have you looked in to adding an eslint rule for this? The eslint rule[1] that recommends usage of ChromeUtils.defineModuleGetter instead of XPCOMUtils.defineLazyModuleGetter has been very useful. [1] https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-chromeutils-import.js#2 Thanks, Jared On Tue, May 8, 2018 at 3:26 PM Kris Maglione wrote: > Bug 1456035 added a ChromeUtils.generateQI helper to create > QueryInterface methods for JS objects. The QueryInterface methods > generated by this function are highly optimized, and have a fast path > for calls from XPConnect. > > Which is to say, please use this method rather than manually writing > your QueryInterface functions, or using XPCOMUtils.generateQI. > QueryInterface methods tend to be very hot code, and all of the extra > overhead from JS implementations adds up fast. > > -Kris > ___ > firefox-dev mailing list > firefox-...@mozilla.org > https://mail.mozilla.org/listinfo/firefox-dev > ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
PSA: Please use ChromeUtils.generateQI for JS QueryInterface methods
Bug 1456035 added a ChromeUtils.generateQI helper to create QueryInterface methods for JS objects. The QueryInterface methods generated by this function are highly optimized, and have a fast path for calls from XPConnect. Which is to say, please use this method rather than manually writing your QueryInterface functions, or using XPCOMUtils.generateQI. QueryInterface methods tend to be very hot code, and all of the extra overhead from JS implementations adds up fast. -Kris ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform