Upgrade to Pro — share decks privately, control downloads, hide ads and more …

FaCSSt: CSS & Performance

Harry Roberts
March 23, 2018

FaCSSt: CSS & Performance

Ahh… CSS and performance. Two of my favourite things! But how well do they play together? It depends…

In this very matter-of-fact talk, we’ll be looking at all of the different ways CSS can make our websites faster or slower. From the common and perhaps more obvious, to the unusual and obscure ways in which CSS can impact performance for better or worse.

Harry Roberts

March 23, 2018
Tweet

More Decks by Harry Roberts

Other Decks in Design

Transcript

  1. “ “The Trainline reduced latency by 0.3 seconds […] and

    customers spent an extra £8.1m a year.” — csswz.it/2FQHt2S
  2. PHN2ZyB3aWR0aD0iNzg1IiBoZWlnaHQ9IjI2OSIgdmlld0JveD0iMCAwIDc4NSAyNjkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHRpdGxlPmxvZ28tMjAxODwvdGl0bGU+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyBmaWxsLXJ1bGU9Im5vbnplcm8iPjxwYXRoIGQ9Ik04NC4wMjQgMT MuNzk0Yy0zOC44NTMgMC03MC40NjIgMzEuNjA4LTcwLjQ2MiA3MC40NjEgMCAzOC44NTMgMzEuNjA5IDcwLjQ2MSA3MC40NjIgNzAuNDYxIDM4Ljg1MiAwIDcwLjQ2MS0zMS42MDggNzAuNDYxLTcwLjQ2MSAwLTM4Ljg1My0zMS42MDktNzAuNDYxLTcwLjQ2MS03MC40NjF6bTAgMTU0LjA3NUMzNy45MTggMTY3Ljg2OS40MDkgMTMw LjM2LjQwOSA4NC4yNTUuNDA5IDM4LjE1IDM3LjkxOC42NDEgODQuMDI0LjY0MWM0Ni4xMDUgMCA4My42MTQgMzcuNTA5IDgzLjYxNCA4My42MTQgMCA0Ni4xMDUtMzcuNTA5IDgzLjYxNC04My42MTQgODMuNjE0eiIgZmlsbD0iI0RGNTMzNiIvPjxwYXRoIGZpbGw9IiNERjUzMzYiIGQ9Ik01OC41NzkgNDEuMTc2aDYy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IDQuMDk2IDEuNTg0IDUuNzZhMTQu NjQ1IDE0LjY0NSAwIDAgMCA0LjA4IDQuMjI0YzEuNjY0IDEuMTUyIDMuNTIgMi4wMTYgNS41NjggMi41OTIgMi4wNDguNTc2IDQuMDY0Ljg2NCA2LjA0OC44NjRzNC0uMzA0IDYuMDQ4LS45MTJhMjAuMTEgMjAuMTEgMCAwIDAgNS42MTYtMi42NCAxNC4xOSAxNC4xOSAwIDAgMCA0LjEyOC00LjI3MmMxLjA1Ni0xLjY5NiAxLjU4NC 0zLjYzMiAxLjU4NC01LjgwOCAwLTIuMTc2LS40OTYtNC4wOTYtMS40ODgtNS43NmExMy43NDggMTMuNzQ4IDAgMCAwLTMuOTM2LTQuMjI0Yy0xLjYzMi0xLjE1Mi0zLjUwNC0yLjAzMi01LjYxNi0yLjY0YTIzLjE0IDIzLjE0IDAgMCAwLTYuNDMyLS45MTJjLTIuMjQgMC00LjM4NC4zMDQtNi40MzIuOTEyLTIuMDQ4LjYwOC0zLjg3 MiAxLjUwNC01LjQ3MiAyLjY4OGExMy43NTggMTMuNzU4IDAgMCAwLTMuODQgNC4zMmMtLjk2IDEuNjk2LTEuNDQgMy42MzItMS40NCA1LjgwOHoiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNNTQ3LjIyMiAxOTh2NzAiIHN0cm9rZS1vcGFjaXR5PSIuMzA0IiBzdHJva2U9IiMzMjNDNEIiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLW xpbmVjYXA9InNxdWFyZSIvPjwvZz48L3N2Zz4=
  3. Time (ms) 0 100 200 300 400 500 600 700

    800 Regular Base64 41.55ms 33.86ms 629ms 280ms 0.84ms 0.083ms Parse First Paint Decode Desktop
  4. Time (ms) 0 1,000 2,000 3,000 4,000 5,000 6,000 7,000

    8,000 9,000 Regular Base64 48.16ms 88.33ms 7,950ms 774ms 2.02ms 0.063ms Parse First Paint Decode Mobile
  5. Key Findings parsing was over 10× slower parsing was over

    32× slower first paint Base64 was 2.25× slower first paint was 10.27× slower
  6. <link rel="stylesheet" href="style.css" /> <link rel="stylesheet" href="reset.css" /> <link rel="stylesheet"

    href="typography.css" /> <link rel="stylesheet" href="grid.css" /> <link rel="stylesheet" href="components.css" />
  7. .nav__item {} .sidebar p {} .icon * {} * {}

    Pretty fast! A little slower Much slower Actually really fast
  8. .nav > ul > li > a {} .nav ul

    li a {} Which is Faster?
  9. “ “Roughly 50% of the time used to calculate the

    computed style for an element is used to match selectors…” — csswz.it/2GIs8l4
  10. .c-btn { display: inline-block; padding: 0.5em 1em; background-color: #f43059; color:

    #fff; cursor: pointer; text-align: center; vertical-align: middle; font: inherit; }
  11. .c-btn { background-color: #f43059; color: #fff; cursor: pointer; display: inline-block;

    font: inherit; padding: 0.5em 1em; text-align: center; vertical-align: middle; }
  12. .btn { display: inline-block; padding: 1em 2em; font: inherit; cursor:

    pointer; text-align: center; vertical-align: middle; } .btn-primary { @extend .btn; background-color: green; color: white; } .btn-secondary { @extend .btn; background-color: red; color: white; } @mixin btn() { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; } .btn { @include btn(); } .btn-primary { @include btn(); background-color: green; color: white; } .btn-secondary { @include btn(); background-color: red; color: white; } @extend 20 LoC Mixin 24 LoC
  13. .btn, .btn-primary, .btn-secondary { display: inline-block; padding: 1em 2em; font:

    inherit; cursor: pointer; text-align: center; vertical-align: middle; } .btn-primary { background-color: green; color: white; } .btn-secondary { background-color: red; color: white; } .btn { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; } .btn-primary { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; background-color: green; color: white; } .btn-secondary { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; background-color: red; color: white; } @extend 18 LoC Mixin 30 LoC
  14. .btn, .btn-primary, .btn-secondary { display: inline-block; padding: 1em 2em; font:

    inherit; cursor: pointer; text-align: center; vertical-align: middle; } .btn-primary { background-color: green; color: white; } .btn-secondary { background-color: red; color: white; } .btn { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; } .btn-primary { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; background-color: green; color: white; } .btn-secondary { display: inline-block; padding: 1em 2em; font: inherit; cursor: pointer; text-align: center; vertical-align: middle; background-color: red; color: white; }
  15. Compression Delta (%) 0 25 50 75 100 @extend Mixin

    68.15% 44.83% (Higher is better) 23.32%
  16. Filesize (Kb) 0 45 90 135 180 Before Gzip After

    Gzip 12Kb 108Kb 18kb 72kb @extend Mixin
  17. “ “My tests showed pretty conclusively that mixins end up

    being better for network performance than using @extend. “The way gzip works means that we get better savings even when our uncompresssed files are substantially larger.” — csswz.it/2jNxNMh
  18. “ “Make CSS small, minify, compress, load from the same

    hostname even (no DNS) and inline, if small enough.” — Stoyan Stefanov, csswz.it/2fYM2ei
  19. LINK in BODY Traditionally, all <link /> elements go in

    the <head> But we can now start putting <link /> in the <body> Effectively progressively rendering pages…
  20. <head> <link rel="stylesheet" href="app.css" /> </head> <body> <header class="page-header">…</header> <section

    class="sidebar">…</section>
 <main class="content">…</main> <footer class="page-foot">…</footer> </body> HTTP/1.1: Bundle everything But this
 contains lots of
 redundancy… …and blocks
 rendering
  21. <head> <link rel="stylesheet" href="common.css" /> <link rel="stylesheet" href="page-header.css" /> <link

    rel="stylesheet" href="sidebar.css" /> <link rel="stylesheet" href="content.css" /> <link rel="stylesheet" href="page-foot.css" /> </head> <body> <header class="page-header">…</header> <section class="sidebar">…</section>
 <main class="content">…</main> <footer class="page-foot">…</footer> </body> HTTP/2: Split everything Much less
 redundancy… …But still
 blocks rendering
  22. <head> <link rel="stylesheet" href="common.css" /> </head> <body> <link rel="stylesheet" href="page-header.css"

    /> <header class="page-header">…</header> <link rel="stylesheet" href="sidebar.css" /> <section class="sidebar">…</section> <link rel="stylesheet" href="content.css" /> <main class="content">…</main> <link rel="stylesheet" href="page-foot.css" /> <footer class="page-foot">…</footer> </body> Nice
  23. “ “Firefox and Edge/IE will give you a lovely progressive

    render, whereas Chrome and Safari give you a white screen until all the CSS loads. “The current Chrome/Safari behaviour is no worse than putting all your stylesheets in the <head>, so you can start using this method today.” — csswz.it/2J0RCj3
  24. <head> <link rel="stylesheet" href="style.css" /> <script> var script = document.createElement('script');

    script.src = "script.js"; document.getElementsByTagName('head')[0].appendChild(script); </script> </head>
  25. <head> <link rel="stylesheet" href="style.css" /> <script> var script = document.createElement('script');

    script.src = "script.js"; document.getElementsByTagName('head')[0].appendChild(script); </script> </head>
  26. 1.Optimise your critical path 2.Keep blocking CSS to a minimum

    3.Avoid Base64 4.@import is evil 5.So is @extend 6.Alphabetic CSS is better 7.Get your head straight Basically… Only for performance For many
 reasons other
 than Performance Except for a
 handful of exceptions