<div dir="ltr">On Wed, Apr 5, 2017 at 12:53 PM, Michael de Boer <span dir="ltr"><<a href="mailto:mdeboer@mozilla.com" target="_blank">mdeboer@mozilla.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On 5 Apr 2017, at 21:17, Jared Hirsch <<a href="mailto:6a68@mozilla.com" target="_blank">6a68@mozilla.com</a>> wrote:</div><br class="m_3225776421169412553Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="m_3225776421169412553m_226613154392545486m_-5628539400423713016gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br class="m_3225776421169412553Apple-interchange-newline">We have an explicit call to webExtension.startup() in our bootstrap.js – would the performance hit be when the startup method is called, or before then (e.g., when the webExtension object is created)?  Just curious if we could accomplish anything by deferring the startup.<br></blockquote><br></span>There should be no significant performance hit until after startup() is called. Hm. Or, at least, there wouldn't if LegacyExtensionUtils didn't eagerly import a couple of other WebExtension modules. We should be able to fix that in an upliftable way, though. XPIProvider really doesn't need to load that module until the startup() method is called.</blockquote><div><br></div><div>Ah, but note that our bootstrap.js directly Cu.import()s LegacyExtensionUtils. Would it help to lazily import that module instead? LegacyExtensionUtils isn't called inside bootstrap until after startup(), so, maybe?<span class="m_3225776421169412553Apple-converted-space"> </span><a href="https://github.com/mozilla-services/screenshots/blob/master/addon/bootstrap.js#L61" target="_blank">https://github.com/<wbr>mozilla-services/screenshots/<wbr>blob/master/addon/bootstrap.<wbr>js#L61</a><br></div></div></div></div></div></blockquote><div><br></div></span><div>Absolutely! These are cheap wins (as in: small change, big impact). I’d do the same thing for AddonManager.jsm (which is a pretty large module to read, parse & evaluate) and Console.jsm.</div><div>The only added JSM would be XPCOMUtils.jsm, but that one’s already required by many other modules, thus won’t add compartments/ overhead.</div></div></div></blockquote><div><br></div><div>AddonManager is already loaded by this point so importing it should cost nothing. I expect we load Console.jsm elsewhere during startup already too. <br></div></div></div></div>