{"id":7753,"date":"2016-04-11T02:57:26","date_gmt":"2016-04-11T09:57:26","guid":{"rendered":"http:\/\/blog.mozilla.org\/addons\/?p=7753"},"modified":"2016-04-08T15:11:08","modified_gmt":"2016-04-08T22:11:08","slug":"the-why-of-electrolysis","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/","title":{"rendered":"The &#8220;Why&#8221; of Electrolysis"},"content":{"rendered":"<p>A <a href=\"https:\/\/developer.mozilla.org\/Firefox\/Multiprocess_Firefox\" target=\"_blank\">multi-process architecture<\/a> is finally coming to Firefox. Known by its codename, &#8220;Electrolysis&#8221; or &#8220;e10s,&#8221; this project aims to split the Firefox browser into a single process for the UI, and several processes for web content, media playback, plugins, etc.<\/p>\n<p>Electrolysis represents a long overdue modernization of Firefox&#8217;s codebase: Internet Explorer has been multi-process since IE 8 Beta 1 in early 2008, Chrome followed six months later, and even Safari went multi-process in the summer of 2011. Put another way, Firefox has been the only major browser using a single process architecture for the past five years.<\/p>\n<h2>Benefits for Users<\/h2>\n<p>Though the result should be visually indistinguishable from a single-process Firefox, the multi-process model offers many compelling advantages in responsiveness, stability, performance, and security:<\/p>\n<ul>\n<li><strong>Responsiveness<\/strong>. By placing web content into a separate process from the browser interface, we can ensure that Firefox&#8217;s UI stays snappy even when a page is doing heavy computation or undergoing garbage collection.<\/li>\n<li><strong>Stability<\/strong>. Tabs shouldn&#8217;t crash, but when they do, isolating web content in separate processes means they can crash without taking down the rest of the browser.<\/li>\n<li><strong>Performance<\/strong>. A multi-process architecture lets us spread work across the many CPU cores present in modern computers and smartphones, resulting in more efficient utilization of the underlying hardware.<\/li>\n<li><strong>Security<\/strong>. Process separation makes it easier to implement restrictive security sandboxes for web content.<\/li>\n<\/ul>\n<p>A common concern is that switching to a multi-processes architecture will dramatically increase Firefox&#8217;s memory usage. This is not the case. While multiple processes <em>will<\/em> have a greater memory footprint than a single process, the impact should be limited: we&#8217;re currently seeing multi-process Firefox use <a href=\"http:\/\/www.erahm.org\/2016\/02\/11\/memory-usage-of-firefox-with-e10s-enabled\/\" target=\"_blank\">10-20% more memory<\/a>, however, it still uses <a href=\"http:\/\/www.erahm.org\/2016\/02\/12\/are-they-slim-yet\/\" target=\"_blank\"><em>half<\/em> the memory of Chrome<\/a> with the same sites loaded.<\/p>\n<p>To ensure we don&#8217;t consume too much RAM, the first release of e10s will only use a single additional process for web content. We&#8217;ll add more processes in subsequent releases, as we become more memory efficient.<\/p>\n<h2>Challenges for Add-on Developers<\/h2>\n<p>The move to multi-process is an investment in the future: we&#8217;re paying down technical debt and redesigning Firefox&#8217;s architecture at a fundamental level. Like any change of this magnitude, there are associated challenges:<\/p>\n<p><strong>1. Cross-Process Communication<\/strong>. Before e10s, add-ons were accustomed to having direct access to both the browser context and web page content. With e10s, those two contexts are now two separate processes which must communicate through <a href=\"https:\/\/developer.mozilla.org\/Firefox\/Multiprocess_Firefox\/Message_Manager\" target=\"_blank\">asynchronous message passing<\/a>.<\/p>\n<p>Many, but not all, add-ons will require modification to work efficiently with this new design. Add-ons that do not access web content, only use <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/SDK\/High-Level_APIs\" target=\"_blank\">high-level SDK APIs<\/a>, or are written with the new <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/WebExtensions\" target=\"_blank\">WebExtension APIs<\/a> will not need modification.<\/p>\n<p>You can see the compatibility status of popular add-ons at <a href=\"https:\/\/www.arewee10syet.com\/\" target=\"_blank\">AreWeE10SYet.com<\/a>, or use the <a href=\"https:\/\/compatibility-lookup.services.mozilla.com\/\" target=\"_blank\">compatibility checker<\/a> to see what changes your add-on might need.<\/p>\n<p><strong>2. Performance<\/strong>. To help with compatibility during the transition to multi-process, we&#8217;ve implemented several <a href=\"https:\/\/developer.mozilla.org\/Firefox\/Multiprocess_Firefox\/Limitations_of_chrome_scripts#Compatibility_shims\" target=\"_blank\">temporary shims<\/a> that allow backwards-compatible, synchronous communication between the browser and web content. This lets add-ons work as if Firefox was still single-process, but with potentially <em>worse<\/em> performance than before, since these shims must completely block multiple processes <em>and<\/em> incur overhead for inter-process communication.<\/p>\n<p>The shims are available to add-ons by default, but authors should <em>always<\/em> prefer <a href=\"https:\/\/developer.mozilla.org\/Firefox\/Multiprocess_Firefox\/Message_Manager\" target=\"_blank\">asynchronous message passing<\/a>, <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/SDK\/High-Level_APIs\" target=\"_blank\">high-level SDK APIs<\/a>, or <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/WebExtensions\" target=\"_blank\">WebExtensions<\/a> instead of shims.<\/p>\n<p><strong>You can disable shims for your add-on by setting the <code>multiprocess<\/code> permission to <code>true<\/code> in your <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/SDK\/Tools\/package_json#Key_reference\" target=\"_blank\">package.json<\/a>, or set <code>&lt;em:multiprocessCompatible&gt;<\/code> to <code>true<\/code> in your <a href=\"https:\/\/developer.mozilla.org\/en-US\/Add-ons\/Install_Manifests#multiprocessCompatible\" target=\"_blank\">install.rdf<\/a>. This is how we know your add-on is e10s-compatible and will ensure that it won\u2019t be marked as incompatible when e10s ships with Firefox.<\/strong><\/p>\n<h2>Try it Today<\/h2>\n<p>Multi-process has been enabled by default in <a href=\"https:\/\/firefox.com\/developer\/\" target=\"_blank\">Firefox Developer Edition<\/a> since version 42, released last August. If you&#8217;re an add-on developer or Firefox enthusiast, we highly recommend you try it out and report any bugs you encounter, either in <a href=\"https:\/\/bugzilla.mozilla.org\/\" target=\"_blank\">Bugzilla<\/a> or in the comments below. The Mozilla Developer Network also hosts <a href=\"https:\/\/developer.mozilla.org\/Firefox\/Multiprocess_Firefox\" target=\"_blank\">extensive documentation<\/a> on multi-process Firefox, including <a href=\"https:\/\/developer.mozilla.org\/Add-ons\/Working_with_multiprocess_Firefox\" target=\"_blank\">migration guides<\/a> for add-on authors. Check it out, and let us know what you think!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A multi-process architecture is finally coming to Firefox. Known by its codename, &#8220;Electrolysis&#8221; or &#8220;e10s,&#8221; this project aims to split the Firefox browser into a single process for the UI, &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/\">Read more<\/a><\/p>\n","protected":false},"author":671,"featured_media":7684,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[388,44,121,742,278886],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The &quot;Why&quot; of Electrolysis - Mozilla Add-ons Community Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dan Callahan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/\",\"name\":\"The \\\"Why\\\" of Electrolysis - Mozilla Add-ons Community Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg\",\"datePublished\":\"2016-04-11T09:57:26+00:00\",\"dateModified\":\"2016-04-08T22:11:08+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/8f9f221d9fd5b4f5bf40b4a096a63486\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg\",\"contentUrl\":\"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg\",\"width\":320,\"height\":320,\"caption\":\"Firefox Logo on blue background\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/addons\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The &#8220;Why&#8221; of Electrolysis\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/addons\/\",\"name\":\"Mozilla Add-ons Community Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/8f9f221d9fd5b4f5bf40b4a096a63486\",\"name\":\"Dan Callahan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a2746e0bf42c3245bfd80dea9b3efb32?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a2746e0bf42c3245bfd80dea9b3efb32?s=96&d=mm&r=g\",\"caption\":\"Dan Callahan\"},\"description\":\"Engineer with Mozilla Developer Relations, former Mozilla Persona developer.\",\"sameAs\":[\"http:\/\/dancallahan.info\",\"https:\/\/x.com\/callahad\"],\"url\":\"https:\/\/blog.mozilla.org\/addons\/author\/dcallahanmozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The \"Why\" of Electrolysis - Mozilla Add-ons Community Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/","twitter_misc":{"Written by":"Dan Callahan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/","url":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/","name":"The \"Why\" of Electrolysis - Mozilla Add-ons Community Blog","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/addons\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage"},"image":{"@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg","datePublished":"2016-04-11T09:57:26+00:00","dateModified":"2016-04-08T22:11:08+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/8f9f221d9fd5b4f5bf40b4a096a63486"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#primaryimage","url":"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg","contentUrl":"https:\/\/blog.mozilla.org\/addons\/files\/2016\/02\/AMO-2016soon-FeaturedImage.jpg","width":320,"height":320,"caption":"Firefox Logo on blue background"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/addons\/2016\/04\/11\/the-why-of-electrolysis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/addons\/"},{"@type":"ListItem","position":2,"name":"The &#8220;Why&#8221; of Electrolysis"}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/addons\/#website","url":"https:\/\/blog.mozilla.org\/addons\/","name":"Mozilla Add-ons Community Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/addons\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/8f9f221d9fd5b4f5bf40b4a096a63486","name":"Dan Callahan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/addons\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a2746e0bf42c3245bfd80dea9b3efb32?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a2746e0bf42c3245bfd80dea9b3efb32?s=96&d=mm&r=g","caption":"Dan Callahan"},"description":"Engineer with Mozilla Developer Relations, former Mozilla Persona developer.","sameAs":["http:\/\/dancallahan.info","https:\/\/x.com\/callahad"],"url":"https:\/\/blog.mozilla.org\/addons\/author\/dcallahanmozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7753"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/users\/671"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/comments?post=7753"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/posts\/7753\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media\/7684"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/media?parent=7753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/categories?post=7753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/addons\/wp-json\/wp\/v2\/tags?post=7753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}