{"componentChunkName":"component---src-templates-blog-post-js","path":"/performance-budgets-with-lighthouse-lighthouse-keeper/","result":{"data":{"site":{"siteMetadata":{"title":"Fabrizio Fortunato","author":"Fabrizio Fortunato","siteUrl":"https://izifortune.com"}},"markdownRemark":{"id":"18413e96-08fe-5cdc-8f60-d7352961d52a","excerpt":"Keep your website on a budget, lighthouse-keeper helps you visualize and create your performance budgets using lighthouse audit reports. Setting up a…","html":"<p>Keep your website on a budget, <a href=\"https://izifortune.github.io/lighthouse-keeper/\">lighthouse-keeper</a> helps you visualize and create your performance budgets using lighthouse audit reports.</p>\n<p>Setting up a performance budget is a healthy practice for yourself, your team and your users as well. As a developer it gives you a goal that you should meet to improve the experience for your users. As a team leader gives you a metric to track your whole team work.</p>\n<p>A performance budget for a website is the process of analysing competitors websites, especially around the pages total weight, the first meaningful paint and other metrics that impact performance for the users.</p>\n<p>There are plenty of articles describing how and why you should set up a performance budget for your website or web application, generally this can serve as a baseline for improving your website performance or set up a goal for your next project.</p>\n<p>A good strategy while setting up a performance budget is picking your competitors and set your budget 20% below the best performing competitor.</p>\n<p>Just as a reminder of how this is important, not only for your users but also for your revenue, google released recently a mobile speed calculator where you can compare how much your performance score can impact your revenue at <a href=\"https://www.thinkwithgoogle.com/feature/mobile/\">https://www.thinkwithgoogle.com/feature/mobile/</a></p>\n<blockquote>\n<p>Your website needs to be at least 20% faster than your competitors.</p>\n</blockquote>\n<p>That’s because for a user to have any noticeable difference, your website needs to be at least 20% faster.</p>\n<p>There are various tools to audit and keep track of the performance of your website, the most known probably are:</p>\n<ul>\n<li><a href=\"https://webpagetest.org\">webpagetest</a> where you can run a free website test using real browsers and across multiple locations.</li>\n<li><a href=\"https://www.sitespeed.io/\">sitespeed</a> a collection of open source tools ready to be used to measure performance.</li>\n<li><a href=\"https://developers.google.com/web/tools/lighthouse/\">lighthouse</a> an open source tool for audit and improving performance of your webpages.</li>\n</ul>\n<p>Lighthouse is the tool that i will focus on for this article. Lighthouse can be used directly from Chrome, just opening the devtools and then click on the audit panel.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 590px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/dist/static/9d22e7725754ad713cb7a8e27054baba/a4b11/Developer_Tools_-_chrome___newtab_-1.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 33.78378378378378%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAHCAIAAACHqfpvAAAACXBIWXMAAAsSAAALEgHS3X78AAAArklEQVQY05WPPQvCQAyG+zsd/TNODgoFZ10FF8G/0KGDg4KIiN5HS1vE4/rNXRJPBScL7UOGJOR9k3hccCkjKSVjTHAuhHD5jd2vp3O0C1h4iLM0S/+QJImHDnJB1lr8QUSAkOVYtdSN19EHohpN+fUZJkZoZgs2HgXzlX2X2E/8mcOyoumymGz2/roZtllrrZ6qrh95k6pC6bwCsH3FxlgCc2TtNmwvsXH/Q8fdL9B1k7CvYDSuAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"lighthouse-devtools\"\n        title=\"lighthouse-devtools\"\n        src=\"/dist/static/9d22e7725754ad713cb7a8e27054baba/102e5/Developer_Tools_-_chrome___newtab_-1.png\"\n        srcset=\"/dist/static/9d22e7725754ad713cb7a8e27054baba/83276/Developer_Tools_-_chrome___newtab_-1.png 148w,\n/dist/static/9d22e7725754ad713cb7a8e27054baba/ba02f/Developer_Tools_-_chrome___newtab_-1.png 295w,\n/dist/static/9d22e7725754ad713cb7a8e27054baba/102e5/Developer_Tools_-_chrome___newtab_-1.png 590w,\n/dist/static/9d22e7725754ad713cb7a8e27054baba/74549/Developer_Tools_-_chrome___newtab_-1.png 885w,\n/dist/static/9d22e7725754ad713cb7a8e27054baba/7213b/Developer_Tools_-_chrome___newtab_-1.png 1180w,\n/dist/static/9d22e7725754ad713cb7a8e27054baba/a4b11/Developer_Tools_-_chrome___newtab_-1.png 2560w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Or as cli</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">npm</span> i -g lighthouse</code></pre></div>\n<p>There are four main audits that lighthouse will perform during an audit:</p>\n<ul>\n<li>Performance</li>\n<li>Accessibility</li>\n<li>PWA</li>\n<li>SEO</li>\n</ul>\n<p>Since we are interesting in setting up performance budgets the one that we will be focusing on will be the performance audit.</p>\n<p>The <em>performance</em> audit collect various metrics on the website, more interesting one while setting a performance budget are:</p>\n<ul>\n<li>Total Size</li>\n<li>First Meaningful Paint</li>\n<li>First Visual Change</li>\n<li>First Interactive</li>\n<li>Visually Complete</li>\n<li>Time to first byte</li>\n<li>JS parse &#x26; com</li>\n</ul>\n<p>Its worth to mention that <em>lighthouse</em> sets some presets for the audit. The default presets are:</p>\n<ul>\n<li>User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10<em>13</em>3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36</li>\n<li>Device Emulation Nexus 5X: Enabled</li>\n<li>Network Throttling 562.5ms RTT, 1.4Mbps down, 0.7Mbps up: Enabled</li>\n<li>CPU Throttling 4x slowdown: Enabled</li>\n</ul>\n<p>I recommend to keep those presets so that your audits will be more consistent even if your connectivity is not the same.</p>\n<p>You can access <em>lighthouse</em> reports either directly in your browser or save them as json files.</p>\n<p>In order to save a report from the browser interface select the download icon</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 590px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/dist/static/2be0d190b1e6f54028d19cdd6418b20a/f3ebc/DevTools_-_example_com_-2.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 106.75675675675676%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAVCAIAAADJt1n/AAAACXBIWXMAAAsSAAALEgHS3X78AAAChUlEQVQ4y41U2XKbMBTl/3+i/9G3PmbSTONpJrGxTWyzCiEktLAIhHsA28kkTadnrjWXK91VR/ZOdz8eN3cb399tdwt86Fg3myDYr9frLTCZt/v9brVaPc64u79/+PXoyW/fzU8/zkkcRsfjMc9zWhRpmoZhmGUkCiNCSAxEMSxJkiZJQtIs51VWVp572DYJoabsutb2vW3bXoh+BtdcGO4GZ63liutGQ2/ahla0tc3onHc+n1WjgjwYRzeO51prk5HBOdgTnmSCQHHOnVgoawl9cENAX7u+g+4hQG0aIaq+H7quK7kQUiHCOI5VJaVUONQhMxfQYXRuNKYeJ5y9kvMwitM0a5qmbVtrO4sGZnSzstjdXMsNROVUFx72CsaqqlrOLajr+qYsdozg5gmdCqo77WEYweuBMcZRWVUppap3QN34CbQi5TBgFCOccY4V3F0GpjV84Isk9QyDtqZ1UpAWu7g/hC7LElGwLl14U+NX3PT3xuVTa43QWBELERe79+HcZ+eb7qa7xMd4M3q4t0IWRBAicipprnKmGTec1/yy1rw0pWrVNdhbjsk5SA/ro/9y2OzSYEP9XBE4MMPeC/wF2HAVeF2ct9Fu5f9+2j8/vT4/R+uX7CUWMRwKXdyEakrVm/Suv/SMSYInp4n8CSF5a1s7WAT9StA8zohaeBg6pUWaEVwqSKqN+esIPwDclq2cSHI6hXGc6Pm2xRXgDCz/DjFlzimNp4eageesnAQlgNjYGr/C0I+99UA6HIVIpf6j4IvvJTOanF+hAmNR9nAF2I/Mi3K1uH6Yq8HbMGbQygPvD8dTnCRoG/87asbyEqZXsbxpJblQCeti1vXDlNYiTVX9ATLNsBMnBgMYAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"DevTools   example com  2\"\n        title=\"DevTools   example com  2\"\n        src=\"/dist/static/2be0d190b1e6f54028d19cdd6418b20a/102e5/DevTools_-_example_com_-2.png\"\n        srcset=\"/dist/static/2be0d190b1e6f54028d19cdd6418b20a/83276/DevTools_-_example_com_-2.png 148w,\n/dist/static/2be0d190b1e6f54028d19cdd6418b20a/ba02f/DevTools_-_example_com_-2.png 295w,\n/dist/static/2be0d190b1e6f54028d19cdd6418b20a/102e5/DevTools_-_example_com_-2.png 590w,\n/dist/static/2be0d190b1e6f54028d19cdd6418b20a/74549/DevTools_-_example_com_-2.png 885w,\n/dist/static/2be0d190b1e6f54028d19cdd6418b20a/7213b/DevTools_-_example_com_-2.png 1180w,\n/dist/static/2be0d190b1e6f54028d19cdd6418b20a/f3ebc/DevTools_-_example_com_-2.png 1448w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>or if you are using the cli specify the option <code class=\"language-text\">--output=json</code> and <code class=\"language-text\">--output-path</code> to save it locally.</p>\n<p>Now that you have the reports in order to get a performance budget you still need to calculate yourself the 20% off all the metrics that we are interested into</p>\n<p>That’s why i created lighthouse-keeper, a visual tool that will calculate automatically your performance budget based upon lighthouse reports.</p>\n<p>To use it you just need to select/drag all the reports which you are interested into and lighthouse-keeper takes care of the rest, displaying the performance of the website selected in a chart and calculating your budget.</p>\n<p>There are three main sections that lighthouse-keeper analyse: <strong>score</strong> which compares the general score for an audit; <strong>timings</strong> contains all the metrics relative to performance timings;\n<strong>bytes</strong> which compare the total bytes size grouped by the different mime/types.</p>\n<h3>Ryanair Rooms Budget</h3>\n<p>In Ryanair we recently launched <a href=\"https://rooms.ryanair.com/\">Ryanair Rooms</a>, where you can find hotels, B&#x26;B, Apartments and Hostels.</p>\n<p>The competitors that i will audit here are:</p>\n<ul>\n<li>booking.com</li>\n<li>airbnb.com</li>\n<li>expedia.com</li>\n<li>trivago.com</li>\n</ul>\n<p>I’m now using lighthouse-keeper to compare the reports and calculate the budget that we should aim for.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 590px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/dist/static/26ab873c4466068e0bec143be9ccd60f/0e2a6/score.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 10.81081081081081%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAIAAADXZGvcAAAACXBIWXMAAAsSAAALEgHS3X78AAAAhUlEQVQI1wF6AIX/AP///vH0+PXx8vjp5O/w7+3n6PDk5dfn0dLc6t7O3c/Mj8vk2NzS7+jEjcfjvb7C7uCeeLDLfvX+/////wD+/f37///mys/Zp33I7MO7xO3TmYSwzX6/3fa8foi4pDaz5dKylb/Lhiqm35+vtejPdUGcvV/z/f////8kKGBJLa51BwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"chart-score\"\n        title=\"chart-score\"\n        src=\"/dist/static/26ab873c4466068e0bec143be9ccd60f/102e5/score.png\"\n        srcset=\"/dist/static/26ab873c4466068e0bec143be9ccd60f/83276/score.png 148w,\n/dist/static/26ab873c4466068e0bec143be9ccd60f/ba02f/score.png 295w,\n/dist/static/26ab873c4466068e0bec143be9ccd60f/102e5/score.png 590w,\n/dist/static/26ab873c4466068e0bec143be9ccd60f/74549/score.png 885w,\n/dist/static/26ab873c4466068e0bec143be9ccd60f/7213b/score.png 1180w,\n/dist/static/26ab873c4466068e0bec143be9ccd60f/0e2a6/score.png 1888w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 590px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/dist/static/3082d44b07ec1a7207412350fcd12f63/0e2a6/bytes.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 10.81081081081081%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAIAAADXZGvcAAAACXBIWXMAAAsSAAALEgHS3X78AAAAb0lEQVQI1yWKPQ6CYBBEuX/lIbyAtR7AWFFhaSyQEBP8WBZm/X52BJli3rxkKtIfbTjfOkonophDsu8wfxQaLaaUuD7ct97ou+6jIksv5XS8tNfD/TU29fPdN4YCWXLMEjANwTNNdBknZkIBA//5ARYgcc4/U7VqAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"chart-bytes\"\n        title=\"chart-bytes\"\n        src=\"/dist/static/3082d44b07ec1a7207412350fcd12f63/102e5/bytes.png\"\n        srcset=\"/dist/static/3082d44b07ec1a7207412350fcd12f63/83276/bytes.png 148w,\n/dist/static/3082d44b07ec1a7207412350fcd12f63/ba02f/bytes.png 295w,\n/dist/static/3082d44b07ec1a7207412350fcd12f63/102e5/bytes.png 590w,\n/dist/static/3082d44b07ec1a7207412350fcd12f63/74549/bytes.png 885w,\n/dist/static/3082d44b07ec1a7207412350fcd12f63/7213b/bytes.png 1180w,\n/dist/static/3082d44b07ec1a7207412350fcd12f63/0e2a6/bytes.png 1888w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 590px;\"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/dist/static/af9985822f75b8b2a259be9504185691/0e2a6/timings.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 10.81081081081081%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAIAAADXZGvcAAAACXBIWXMAAAsSAAALEgHS3X78AAAAe0lEQVQI12P4/+/vs5cfHrz89v/b1+9fv/75+fH/31/Hrj29d+fOj69vv3379f/Xj3///v5HBf/+/QOSDEDGy/fftu+6/uT+mVcfP7+8/+z121t7j7891F907vaKs6eeX1nTdPv19R8ff3548+bz518vHj5+9+rWH7ARALg4bhn7IXeMAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"chart-timings\"\n        title=\"chart-timings\"\n        src=\"/dist/static/af9985822f75b8b2a259be9504185691/102e5/timings.png\"\n        srcset=\"/dist/static/af9985822f75b8b2a259be9504185691/83276/timings.png 148w,\n/dist/static/af9985822f75b8b2a259be9504185691/ba02f/timings.png 295w,\n/dist/static/af9985822f75b8b2a259be9504185691/102e5/timings.png 590w,\n/dist/static/af9985822f75b8b2a259be9504185691/74549/timings.png 885w,\n/dist/static/af9985822f75b8b2a259be9504185691/7213b/timings.png 1180w,\n/dist/static/af9985822f75b8b2a259be9504185691/0e2a6/timings.png 1888w\"\n        sizes=\"(max-width: 590px) 100vw, 590px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n  </a>\n    </span></p>\n<p>Setting up a performance budget on a new or existing project its a great way to set a trackable and very impactful metric for you and your team.</p>\n<p>Lighthouse-keeper is open-source and available <a href=\"https://izifortune.github.io/lighthouse-keeper/\">here</a>.</p>\n<p>And remember #perfmatters.</p>","frontmatter":{"title":"Performance budgets with Lighthouse - Lighthouse keeper","date":"April 17, 2018","description":null,"socialImage":{"childImageSharp":{"fixed":{"src":"/dist/static/8c46113951dec02ed4e114c14cd1eef2/048fd/lighthouse.png"}}},"image":{"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAIAAAC9o5sfAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQoz2NQSdwNR0oJe+Ti9srH7VWI26sUv1spaZds4n4gqZK0UyVxDxjtRkYMEEo1cbdi/B6XkrXRjUu8ylfbF601TNlvHnxiTnCsk/9WuYjTqok7VBJ34dCctEsudl9y24LpS7t6FvR2TlhcUXWgs2zt/4UKRW5rxc3/qyS8Vk46jKYfxWb7wg3BdcucIq5a27/XMf/i4fb8QOOkYMuTChb/Vaz+K3s+UEnegex4BmSTFJN2ygeeV9H5r2j+Vzzsv4v/wxNZ5RZ2L1UM/qnp/FY1+KUSeUwleSc2zQl7VFO2q7k+VNf9q+n0U9Hvv1n8j/7yi252X5U1/2sY/1bX/6fsdUsldRtQJabm3SBX2bxR0/6vpvdHy/VOQN2Crr5oy/TZ8r431E2/q2n9V3V5iENzIliz520V1weqUYcdFie6bfDWaumSnl4htzBLKW2bivsdFf/LKik7cGiGGwGM2/i9SjFHVKOOqkUfArIR4kgqAX/s6txUvscLAAAAAElFTkSuQmCC","aspectRatio":2.352112676056338,"src":"/dist/static/9a37d9716f7a0500d32f04301023aaa0/a5924/lighthouse2.png","srcSet":"/dist/static/9a37d9716f7a0500d32f04301023aaa0/17cc0/lighthouse2.png 167w,\n/dist/static/9a37d9716f7a0500d32f04301023aaa0/f7869/lighthouse2.png 333w,\n/dist/static/9a37d9716f7a0500d32f04301023aaa0/a5924/lighthouse2.png 666w,\n/dist/static/9a37d9716f7a0500d32f04301023aaa0/4f774/lighthouse2.png 674w","sizes":"(max-width: 666px) 100vw, 666px"}}}}}},"pageContext":{"slug":"/performance-budgets-with-lighthouse-lighthouse-keeper/","previous":{"fields":{"slug":"/multiple-packages-repository-with-angular/"},"frontmatter":{"title":"Multiple packages repository with Angular"}},"next":{"fields":{"slug":"/snapshot-testing-angular-applications/"},"frontmatter":{"title":"Snapshot testing Angular applications"}}}}}