SlideShare a Scribd company logo
Vlad zelinschi   optimizing the critical rendering path
Optimizing the CRP 
(Critical Rendering Path)
Vlad Zelinschi 
Frontend Engineer at Yonder 
@vladzelinschi
“One does not simply optimizes the 
critical rendering path so easily…”
Reasons for being here 
• Easy to construct large apps and just … “go with the 
flow” 
• Performance should be in your head right from the 
start (this does not mean over-optimizing early on!!) 
• Demanding clients, demanding users, demanding 
developers, high standards
SPEED IS A 
FEATURE
What is the CRP?
“[…] what happens in these intermediate steps 
between receiving the HTML, CSS, and 
JavaScript bytes and the required processing to 
turn them into rendered pixels - that’s the critical 
Google Developers 
rendering path.”
Vlad zelinschi   optimizing the critical rendering path
Candy break …
Enter The Network … 
• DNS Lookup to resolve the hostname to IP address 
• New TCP connection (if necessary) 
• TLS/SSL handshake happening (worst case 
scenario) 
• HTTP request for index.html
Some TCP knowledge 
• TCP is designed to probe the network to figure out 
the available capacity 
• TCP does not use the full capacity from the start 
• TCP Slow Start - for congestion control and 
avoidance 
• For the first roundtrip ~ 14KB (10 TCP packets)
Vlad zelinschi   optimizing the critical rendering path
let’s get the index.html
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
What browsers do … 
• Conversion: from raw bytes to individual characters 
(based on encoding - ex: UTF-8) 
• Tokenizing: converts strings of characters into distinct 
tokens specified by the W3C HTML5 standard 
• Lexing: tokens are converted into “objects” which 
define their properties and rules 
• DOM construction: relation between tags, tree-like 
construction
Vlad zelinschi   optimizing the critical rendering path
same for CSS …
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
then the render tree …
Vlad zelinschi   optimizing the critical rendering path
Render, Layout, Paint 
• Final stages before getting something on screen 
• The Layout calculates the exact position and size of 
the elements in the viewport 
• The render tree construction, position and size 
calculation are captured with the “Layout” event in 
the Timeline (Chrome Dev Tools) 
• Paint - converts the render tree to actual pixels
Recap 
• Process HTML markup and build the DOM tree 
• Process CSS markup and build the CSSOM tree 
• Combine the DOM and CSSOM into a render tree 
• Run layout on the render tree to compute geometry 
of each node 
• Paint the individual nodes to the screen
Optimizing the critical rendering path is the 
process of minimizing the total amount of time 
spent in steps one through five in the previous 
slide.
Perf rules to keep in mind 
• HTML is parsed incrementally 
• CSS is render blocking (can’t construct the CSSOM 
and the render tree without it) 
• CSS is not incremental (we must wait for the entire 
file to download)
Vlad zelinschi   optimizing the critical rendering path
What about JavaScript?
Vlad zelinschi   optimizing the critical rendering path
JavaScript - friend and foe 
• The location of the script in the document is significant 
• DOM construction is paused when a script tag is 
encountered and until the script has finished executing 
(JS is parser-blocking) 
• JavaScript can query and modify the DOM and 
CSSOM 
• JavaScript execution is delayed until the CSSOM is 
ready
How can we have pixels 
on screen after just one 
RTT (round trip time)?
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering path
Optimizing the CRP 
• Get CSS down to the client as fast as possible 
• Eliminate blocking JavaScript from the CRP (your 
friend, async) 
• Aim for the fastest domContentLoaded time (DOM 
and CSSOM are ready)
Optimizing the CRP 
• Concentrate on the above the fold content - ATF 
(what the user sees first) 
• Inline CSS and JS for ATF (remember the 14KB 
limit?) 
• Put your critical assets on the same domain 
• Consider minifying HTML
Tools for the trade 
• https://github.com/filamentgroup/grunt-criticalcss 
• https://github.com/bezoerb/grunt-critical 
• https://github.com/filamentgroup/loadCSS 
• https://github.com/filamentgroup/loadJS 
• https://developers.google.com/speed/pagespeed/
Real world example 
https://www.fasetto.com/
Thank you!
Q&A anyone?
Vlad zelinschi   optimizing the critical rendering path
Please fill the online evaluation form after event 
Optimizing the CRP (Critical Rendering Path) 
Vlad Zelinschi 
Frontend Engineer at Yonder

More Related Content

PPTX
Evolution of java script libraries
PDF
Introduction to Nodejs and Isomorphic javascript
PPTX
Javascript for Wep Apps
PDF
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
PDF
AEM/CQ Montreal User Group Meeting - March 25, 2015 - Takeaways from Adobe Su...
PPTX
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
KEY
MongoDB SF Python
PDF
Back to the future with static site generators
Evolution of java script libraries
Introduction to Nodejs and Isomorphic javascript
Javascript for Wep Apps
JS Lab`16. Андрей Колодницкий: "Разработка REST сервисов на SailsJS"
AEM/CQ Montreal User Group Meeting - March 25, 2015 - Takeaways from Adobe Su...
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
MongoDB SF Python
Back to the future with static site generators

What's hot (20)

PPTX
ReactJS - Re-rendering pages in the age of the mutable DOM
PPTX
Web assembly: a brief overview
PDF
Use all the buzzwords
PPTX
mongodb-brief-intro-february-2012
PDF
Masterin Large Scale Java Script Applications
PDF
Meanstack Introduction by Kishore Chandra
PPTX
What is Mean Stack Development ?
PDF
Metarefresh
PDF
Simple cloud reference architecture
PDF
ASP.NET Scalability - VBUG London
PDF
Adobe AEM for Business Heads
PDF
Harnessing the cloud_for_saa_s_hosted_platfor
PDF
ASP.NET Scalability - DDD7
PDF
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
PDF
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
PPTX
Become a Successful Web Developer in Web development Field in 2017
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
PDF
ASP.NET Scalability - WebDD
PDF
MEAN Stack
ReactJS - Re-rendering pages in the age of the mutable DOM
Web assembly: a brief overview
Use all the buzzwords
mongodb-brief-intro-february-2012
Masterin Large Scale Java Script Applications
Meanstack Introduction by Kishore Chandra
What is Mean Stack Development ?
Metarefresh
Simple cloud reference architecture
ASP.NET Scalability - VBUG London
Adobe AEM for Business Heads
Harnessing the cloud_for_saa_s_hosted_platfor
ASP.NET Scalability - DDD7
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Become a Successful Web Developer in Web development Field in 2017
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
ASP.NET Scalability - WebDD
MEAN Stack
Ad

Viewers also liked (8)

PPTX
Alex lakatos state of mobile web
PPTX
Flavius olaru logicless ui prototyping with node js
PPTX
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
PPTX
Diaconu andrei list view vs recyclerview in android l
PDF
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
PDF
Material design screen transitions in android
PPTX
Parallel & async processing using tpl dataflow
PDF
The bigrewrite
Alex lakatos state of mobile web
Flavius olaru logicless ui prototyping with node js
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Diaconu andrei list view vs recyclerview in android l
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Material design screen transitions in android
Parallel & async processing using tpl dataflow
The bigrewrite
Ad

Similar to Vlad zelinschi optimizing the critical rendering path (20)

PPTX
Browsers. Magic is inside.
PDF
Exploring Critical Rendering Path
PPTX
Building high performing web pages
PDF
#Webperf Choreography
PDF
PAC 2019 virtual Mark Tomlinson
PPT
Java script
PPT
Java script
PDF
Chrome Internals: Paint and Composition
PDF
Web Components at Scale, HTML5DevConf 2014-10-21
PDF
Navigating the critical rendering path - Jamie Alberico - VirtuaCon
PDF
Performance (browser)
PDF
Incremental DOM and Recent Trend of Frontend Development
PPTX
Announcing StencilJS
PDF
Алексей Швайка "Bundling: you are doing it wrong"
PDF
Web Development with Delphi and React - ITDevCon 2016
PDF
Group meeting: Polaris - Faster Page Loads Using Fine-grained Dependency Trac...
PDF
How Browsers Work
PDF
Ustream Techtalks: Google Chrome Developer Tools
PDF
Post-relational databases: What's wrong with web development?
Browsers. Magic is inside.
Exploring Critical Rendering Path
Building high performing web pages
#Webperf Choreography
PAC 2019 virtual Mark Tomlinson
Java script
Java script
Chrome Internals: Paint and Composition
Web Components at Scale, HTML5DevConf 2014-10-21
Navigating the critical rendering path - Jamie Alberico - VirtuaCon
Performance (browser)
Incremental DOM and Recent Trend of Frontend Development
Announcing StencilJS
Алексей Швайка "Bundling: you are doing it wrong"
Web Development with Delphi and React - ITDevCon 2016
Group meeting: Polaris - Faster Page Loads Using Fine-grained Dependency Trac...
How Browsers Work
Ustream Techtalks: Google Chrome Developer Tools
Post-relational databases: What's wrong with web development?

More from Codecamp Romania (20)

PDF
Cezar chitac the edge of experience
PPTX
Cloud powered search
PPTX
Business analysis techniques exercise your 6-pack
PPTX
Bpm company code camp - configuration or coding with pega
PPT
Andrei prisacaru takingtheunitteststothedatabase
PPTX
Agility and life
PPTX
2015 dan ardelean develop for windows 10
PDF
The case for continuous delivery
PPTX
Stefan stolniceanu spritekit, 2 d or not 2d
PPTX
Sizing epics tales from an agile kingdom
PPTX
Scale net apps in aws
PPTX
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
PDF
Kickstart your own freelancing career
PDF
Ecma6 in the wild
PPTX
Diana antohi me against myself or how to fail and move forward
PDF
Codecamp2015 pimp yourpipeline-saade-jens-1.1
PPTX
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
PPTX
About leadership
PPTX
Business analysis techniques exercise your 6-pack
Cezar chitac the edge of experience
Cloud powered search
Business analysis techniques exercise your 6-pack
Bpm company code camp - configuration or coding with pega
Andrei prisacaru takingtheunitteststothedatabase
Agility and life
2015 dan ardelean develop for windows 10
The case for continuous delivery
Stefan stolniceanu spritekit, 2 d or not 2d
Sizing epics tales from an agile kingdom
Scale net apps in aws
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Kickstart your own freelancing career
Ecma6 in the wild
Diana antohi me against myself or how to fail and move forward
Codecamp2015 pimp yourpipeline-saade-jens-1.1
Code camp iasi silviu niculita - machine learning for mere mortals with azu...
About leadership
Business analysis techniques exercise your 6-pack

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
Approach and Philosophy of On baking technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
Approach and Philosophy of On baking technology
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Mobile App Security Testing_ A Comprehensive Guide.pdf
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Unlocking AI with Model Context Protocol (MCP)

Vlad zelinschi optimizing the critical rendering path

  • 2. Optimizing the CRP (Critical Rendering Path)
  • 3. Vlad Zelinschi Frontend Engineer at Yonder @vladzelinschi
  • 4. “One does not simply optimizes the critical rendering path so easily…”
  • 5. Reasons for being here • Easy to construct large apps and just … “go with the flow” • Performance should be in your head right from the start (this does not mean over-optimizing early on!!) • Demanding clients, demanding users, demanding developers, high standards
  • 6. SPEED IS A FEATURE
  • 7. What is the CRP?
  • 8. “[…] what happens in these intermediate steps between receiving the HTML, CSS, and JavaScript bytes and the required processing to turn them into rendered pixels - that’s the critical Google Developers rendering path.”
  • 11. Enter The Network … • DNS Lookup to resolve the hostname to IP address • New TCP connection (if necessary) • TLS/SSL handshake happening (worst case scenario) • HTTP request for index.html
  • 12. Some TCP knowledge • TCP is designed to probe the network to figure out the available capacity • TCP does not use the full capacity from the start • TCP Slow Start - for congestion control and avoidance • For the first roundtrip ~ 14KB (10 TCP packets)
  • 14. let’s get the index.html
  • 17. What browsers do … • Conversion: from raw bytes to individual characters (based on encoding - ex: UTF-8) • Tokenizing: converts strings of characters into distinct tokens specified by the W3C HTML5 standard • Lexing: tokens are converted into “objects” which define their properties and rules • DOM construction: relation between tags, tree-like construction
  • 24. then the render tree …
  • 26. Render, Layout, Paint • Final stages before getting something on screen • The Layout calculates the exact position and size of the elements in the viewport • The render tree construction, position and size calculation are captured with the “Layout” event in the Timeline (Chrome Dev Tools) • Paint - converts the render tree to actual pixels
  • 27. Recap • Process HTML markup and build the DOM tree • Process CSS markup and build the CSSOM tree • Combine the DOM and CSSOM into a render tree • Run layout on the render tree to compute geometry of each node • Paint the individual nodes to the screen
  • 28. Optimizing the critical rendering path is the process of minimizing the total amount of time spent in steps one through five in the previous slide.
  • 29. Perf rules to keep in mind • HTML is parsed incrementally • CSS is render blocking (can’t construct the CSSOM and the render tree without it) • CSS is not incremental (we must wait for the entire file to download)
  • 33. JavaScript - friend and foe • The location of the script in the document is significant • DOM construction is paused when a script tag is encountered and until the script has finished executing (JS is parser-blocking) • JavaScript can query and modify the DOM and CSSOM • JavaScript execution is delayed until the CSSOM is ready
  • 34. How can we have pixels on screen after just one RTT (round trip time)?
  • 39. Optimizing the CRP • Get CSS down to the client as fast as possible • Eliminate blocking JavaScript from the CRP (your friend, async) • Aim for the fastest domContentLoaded time (DOM and CSSOM are ready)
  • 40. Optimizing the CRP • Concentrate on the above the fold content - ATF (what the user sees first) • Inline CSS and JS for ATF (remember the 14KB limit?) • Put your critical assets on the same domain • Consider minifying HTML
  • 41. Tools for the trade • https://github.com/filamentgroup/grunt-criticalcss • https://github.com/bezoerb/grunt-critical • https://github.com/filamentgroup/loadCSS • https://github.com/filamentgroup/loadJS • https://developers.google.com/speed/pagespeed/
  • 42. Real world example https://www.fasetto.com/
  • 46. Please fill the online evaluation form after event Optimizing the CRP (Critical Rendering Path) Vlad Zelinschi Frontend Engineer at Yonder