{"id":2915,"date":"2018-04-18T16:47:35","date_gmt":"2018-04-18T21:47:35","guid":{"rendered":"https:\/\/mikeconley.ca\/blog\/?p=2915"},"modified":"2023-12-20T16:25:10","modified_gmt":"2023-12-20T21:25:10","slug":"firefox-performance-update-6","status":"publish","type":"post","link":"https:\/\/mikeconley.ca\/blog\/2018\/04\/18\/firefox-performance-update-6\/","title":{"rendered":"Firefox Performance Update #6"},"content":{"rendered":"<p>Hi there folks, just another Firefox Performance update coming at you here.<\/p>\n<p>These updates are going to shift format slightly. I&#8217;m going to start by highlighting the status of some of the projects the Firefox Performance Team (the front-end team working to make Firefox snappy AF), and then go into the grab-bag list of improvements that we&#8217;ve seen landing in the tree.<\/p>\n<h2>But first a word from our sponsor: arewesmoothyet.com!<\/h2>\n<p>This performance update is brought to you by <a href=\"http:\/\/arewesmoothyet.com\/\">arewesmoothyet.com<\/a>! On Nightly versions of Firefox, a component called BackgroundHangReporter (or &#8220;BHR&#8221;) notices anytime the main-threads hang too long, and then collect a stack to send via Telemetry. We&#8217;ve been doing this for years, but we&#8217;ve never really had a great way of visualizing or making use of the data<sup id=\"rf1-2915\"><a href=\"#fn1-2915\" title=\"Pro-tip: if you&#8217;re collecting data, consider figuring out how you want to visualize it first, and then make sure that visualization work actually happens.\" rel=\"footnote\">1<\/a><\/sup>. Enter <a href=\"http:\/\/arewesmoothyet.com\/\">arewesmoothyet.com<\/a> by <a href=\"https:\/\/github.com\/squarewave\">Doug Thayer<\/a>! Initially a fork of <a href=\"https:\/\/perf-html.io\/\">perf.html<\/a>, awsy.com lets us <a href=\"http:\/\/arewesmoothyet.com\/?mode=track&amp;trackedStat=All%20Hangs\">see graphs of hangs on Nightly broken down by category<\/a><sup id=\"rf2-2915\"><a href=\"#fn2-2915\" title=\"since April 1st, these categories have gotten a lot finer-grain\" rel=\"footnote\">2<\/a><\/sup>, and then also lets us <a href=\"http:\/\/arewesmoothyet.com\/?category=all&amp;durationSpec=512_2048&amp;mode=explore&amp;thread=0\">explore the individual stacks that have come in using a perf.html-like interface!<\/a> (You might need to be patient on that last link &#8211; it&#8217;s a lot of data to download).<\/p>\n<div id=\"attachment_2916\" style=\"width: 1039px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2916\" data-attachment-id=\"2916\" data-permalink=\"https:\/\/mikeconley.ca\/blog\/2018\/04\/18\/firefox-performance-update-6\/untitled\/\" data-orig-file=\"https:\/\/mikeconley.ca\/blog\/wp-content\/uploads\/2018\/04\/Untitled.png\" data-orig-size=\"1029,392\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"arewesmoothyet.com graphs!\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Hot damn! Note the finer-grain categories showing up on April 1st.&lt;\/p&gt;\n\" data-large-file=\"https:\/\/mikeconley.ca\/blog\/wp-content\/uploads\/2018\/04\/Untitled.png\" class=\"size-full wp-image-2916\" src=\"https:\/\/mikeconley.ca\/blog\/wp-content\/uploads\/2018\/04\/Untitled.png\" alt=\"\" width=\"1029\" height=\"392\" \/><p id=\"caption-attachment-2916\" class=\"wp-caption-text\">Hot damn! Note the finer-grain categories showing up on April 1st.<\/p><\/div>\n<h2>Early first blank paint (lead by Florian Qu\u00e8ze)<\/h2>\n<p>This is a start-up perceived performance project where early in the executable life-cycle, long before we&#8217;ve figured out how to layout and paint the browser UI, we show a white &#8220;blank&#8221; area on screen that is overtaken with the UI once it&#8217;s ready. The idea here is to avoid having the user stare at nothing after clicking on the Firefox icon. We&#8217;ll also naturally be working to reduce the amount of time that the blank window appears for users, but our research shows users feel like the browser starts-up faster when we show <strong>something<\/strong> rather than <strong>nothing<\/strong>. Even if that nothing is&#8230; well, mostly nothing. Florian <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1453782\">recently landed a Telemetry probe<\/a> for this feature, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1450293\">made it so that we can avoid initting the GPU process for the blank window<\/a>, and is in the midst of <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1454908\">fixing an issue where the blank window appears for too long<\/a>. We&#8217;re hoping to have this ready to ship enabled on some platforms (ideally Linux and Windows) in Firefox 61.<\/p>\n<h2>Faster content process start-up time (lead by Felipe Gomes)<\/h2>\n<p>Explorations are just beginning here. Felipe has been examining the scripts that are running for each tab on creation, and has a few ideas on how to both reduce their parsing overhead, as well as making them lazier to load. This project is mostly at the research stage. Expect concrete details on sub-projects and linked bugs soon!<\/p>\n<h2>Get ContentPrefService init off of the main thread (lead by Doug Thayer)<\/h2>\n<p>This is so, so close to being done. <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=887889\">The patch is written and reviewed<\/a>, but landing it is being stymied by a hard-to-reproduce locally but super-easy-to-reproduce-in-automation shutdown leak during test runs. Unfortunately, the last 10% sometimes takes 90% of the effort, and this looks like one of those cases.<\/p>\n<h2>Blocklist improvements (lead by Gijs Kruitbosch)<\/h2>\n<p>Gijs is continuing to make our blocklist asynchronous. Recently, <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1452618\">he made the getAddonBlocklistEntry method of the API asynchronous<\/a>, which is a big-deal for start-up, since it means we drop another place where the front-end has to wait for the blocklist to be ready! The <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1454456\">getAddonBlocklistState<\/a> method is next on the list.<\/p>\n<p>As a fun exercise, <a href=\"https:\/\/mzl.la\/2J9d55d\">you can follow the &#8220;true&#8221; value for the BLOCKLIST_SYNC_FILE_LOAD probe via this graph<\/a>, and watch while Gijs buries it into the ground.<\/p>\n<h2>LRU cache for tab layers (lead by Doug Thayer)<\/h2>\n<p>Doug Thayer is following up on some research done a few years ago that suggests that we can make ~95% of our user&#8217;s tab switches feel instantaneous by <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1176019\">implementing an LRU cache for the painted layers<\/a>. This is a classic space-time trade-off, as the cache will necessarily consume memory in order to hold onto the layers. Research is currently underway here to see how we can continue to improve our tab switching performance <a href=\"http:\/\/www.erahm.org\/2017\/09\/25\/firefox-memory-usage-in-the-quantum-era\/\">without losing out on the memory advantage that we tend to have over other browsers<\/a>.<\/p>\n<h2>Tab warming (lead by Mike Conley)<\/h2>\n<p><a href=\"https:\/\/mikeconley.ca\/blog\/2018\/01\/11\/making-tab-switching-faster-in-firefox-with-tab-warming\/\">Tab warming<\/a> has been enabled on Nightly for a few weeks, and <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1447193\">besides one rather serious glitch that we&#8217;ve fixed<\/a>, we&#8217;ve been pretty pleased with the result! <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1453080\">There&#8217;s one issue on macOS that&#8217;s been mulled over,<\/a> but at this point I&#8217;m starting to lean towards getting this shipped on at least Windows for the Firefox 61 release.<\/p>\n<h2>Firefox&#8217;s Most Wanted: Performance Wins (lead by YOU!)<\/h2>\n<p>Before we go into the grab-bag list of performance-related fixes &#8211; have you seen any patches landing that should positively impact Firefox&#8217;s performance? <a href=\"https:\/\/docs.google.com\/forms\/u\/1\/d\/e\/1FAIpQLScbw2cwXvGX09-U0XQyBBcLRX7WMoU6Ja_jR1pX3rXXbkBWbw\/viewform?usp=send_form\">Let me know about it<\/a> so I can include it in the list, and give appropriate shout-outs to all of the great work going on! <a href=\"https:\/\/docs.google.com\/forms\/u\/1\/d\/e\/1FAIpQLScbw2cwXvGX09-U0XQyBBcLRX7WMoU6Ja_jR1pX3rXXbkBWbw\/viewform?usp=send_form\">That link again!<\/a><\/p>\n<h2>Grab-bag time<\/h2>\n<p>And now, without further ado, a list of performance work that took place in the tree:<\/p>\n<p>(\ud83c\udf1f indicates a volunteer contributor)<\/p>\n<ul>\n<li>Rob Wood and Greg Tatum <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1425303\">made it so that Nightly profiled Talos jobs now link directly to perf.html from Treeherder!<\/a><\/li>\n<li>Gijs Kruitbosch <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1371523\">made it so that we don&#8217;t send a sync IPC message every time you keypress with the Findbar open!<\/a><\/li>\n<li>Kris Maglione <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1451058\">made it so that we recycle the panel used by WebExtensions, which should make them cheaper to open<\/a><\/li>\n<li>Kartikaya Gupta <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1452111\">made it so that painting a TicketMaster page showing the seating diagram of a venue much, much faster<\/a><\/li>\n<li>Florian Qu\u00e8ze <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=854464\">made it so that we spend far less resources painting the progress bars for downloads<\/a><\/li>\n<li>Ludovic Hirlimann <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=1371346\">got rid of the Presentation API system add-on<\/a>, since it was running some code during start-up on Nightly, but wasn&#8217;t actually being used anywhere.<\/li>\n<\/ul>\n<p>Thanks to all of you! Keep it coming!<\/p>\n<hr class=\"footnotes\"><ol class=\"footnotes\" style=\"list-style-type:decimal\"><li id=\"fn1-2915\"><p >Pro-tip: if you&#8217;re collecting data, consider figuring out how you want to visualize it first, and then make sure that visualization work actually happens.&nbsp;<a href=\"#rf1-2915\" class=\"backlink\" title=\"Return to footnote 1.\">&#8617;<\/a><\/p><\/li><li id=\"fn2-2915\"><p >since April 1st, these categories have gotten a lot finer-grain&nbsp;<a href=\"#rf2-2915\" class=\"backlink\" title=\"Return to footnote 2.\">&#8617;<\/a><\/p><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Hi there folks, just another Firefox Performance update coming at you here. These updates are going to shift format slightly. I&#8217;m going to start by highlighting the status of some of the projects the Firefox Performance Team (the front-end team working to make Firefox snappy AF), and then go into the grab-bag list of improvements [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5,874,861],"tags":[],"class_list":["post-2915","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-firefox-mozilla-2","category-mozilla-2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prmTy-L1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/comments?post=2915"}],"version-history":[{"count":2,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2915\/revisions"}],"predecessor-version":[{"id":2918,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/posts\/2915\/revisions\/2918"}],"wp:attachment":[{"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/media?parent=2915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/categories?post=2915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikeconley.ca\/blog\/wp-json\/wp\/v2\/tags?post=2915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}