<div dir="ltr"><div>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.</div><div><br></div><div>[1] <a href="https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-chromeutils-import.js#2">https://searchfox.org/mozilla-central/rev/da499aac682d0bbda5829327b60a865cbc491611/tools/lint/eslint/eslint-plugin-mozilla/lib/rules/use-chromeutils-import.js#2</a></div><div><br></div><div>Thanks,</div><div>Jared<br></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, May 8, 2018 at 3:26 PM Kris Maglione <<a href="mailto:kmaglione@mozilla.com">kmaglione@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bug 1456035 added a ChromeUtils.generateQI helper to create <br>
QueryInterface methods for JS objects. The QueryInterface methods <br>
generated by this function are highly optimized, and have a fast path <br>
for calls from XPConnect.<br>
<br>
Which is to say, please use this method rather than manually writing <br>
your QueryInterface functions, or using XPCOMUtils.generateQI. <br>
QueryInterface methods tend to be very hot code, and all of the extra <br>
overhead from JS implementations adds up fast.<br>
<br>
-Kris<br>
_______________________________________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/firefox-dev</a><br>
</blockquote></div>