DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Web Performance 101: Critical Render Path

To optimize the critical render path for your web page, you must analyze the assets that are critical to the initial view.

Kameerath Abdul Kareem user avatar by
Kameerath Abdul Kareem
·
Jan. 31, 17 · Opinion
Like (5)
Save
Tweet
Share
3.53K Views

Join the DZone community and get the full member experience.

Join For Free

the success of a website is directly proportional to the users’ digital experience. in the age of tech, savvy consumers, and competitive targeted marketing, speed matters. users expect websites to load fast. the faster the user can view the web page, the better the digital experience. we’ve already discussed how page size , images , and scripts can affect web page load time and how each of these factors can be optimized to deliver the best user experience. in this article, we look at another important factor that determines web performance: critical render path.

what is critical render path?

the series of events involved in downloading website resources (html, css, and scripts), processing, and rendering the first pixel on the page is called the critical render path.

image title

a browser needs to construct the structure of the page before rendering. the web page data structure has two main components: dom (document object model) and cssom (css object model). the browser parses the page html to form the dom while the css is used to build the cssom.

the html is received by the browser in raw bytes, which is converted to characters. the html markup tokens and tags (for example: “<head>”, “<body>”) are then generated. these tags are then mapped to form nodes that make up the dom tree.

full-process a similar process is carried out by the browser when it receives the css rules. the data is converted to characters and tokens, which are then linked to form the cssom tree.

cssom-tree the dom and the cssom together form the final render tree. the browser paints each node on the page following the render tree path. the entire process takes time and can impact the overall performance of the web page.

how significant is the critical render path?

the initial view of the page, or what the user views above the fold, is critical to the end-user experience. optimizing each step in the critical render path will speed up the rendering process of above-the-fold content, resulting in a better digital experience.

if the page html contains any render-blocking script or css, then the render start will be delayed. most websites are cluttered with multiple css files, scripts, and images that are not critical for rendering the first pixel. a user is more likely to wait for a page to load if an initial layout is displayed versus a blank page.

we can see this in action in the image below. the filmstrip shows the number of seconds the page remains blank before the first pixel is displayed. amazon paints the first pixel within a second while nordstrom takes 2.4 seconds.

amazonvsnord_renderstart the time taken by the initial render sets the tone for the users’ digital experience. the user perceives a better web performance even if the rest of the page takes another second to fully load.

let us compare the critical render path from another perspective. the following waterfall graphs give us a better understanding of the page design and critical render path. the graph below for axis bank shows several scripts and other resources being loaded before the page starts to render. this can be detrimental to the end-users’ digital experience.

axisbankwaterfall in contrast, the waterfall chart for u.s. bank gives an example of an optimized render path. there are fewer resources that need to be downloaded before the initial render.

usbankwaterfall what is the ideal render path?

to optimize the critical render path, we must focus on the following three factors.

  1. reducing the number of critical assets to allow the browser to start rendering the initial view/above-the-fold content quickly without waiting for the rest of the resources to complete loading.
  2. minimizing the byte size of the critical resources to reduce browser overhead and help speed up the rendering process.
  3. optimizing the order in which each critical resource is downloaded or lazy-loading assets that are not critical to minimize the round trips the browser needs to make to fetch each critical resource and in effect reduce the length of the critical render path.

to build the ideal render path for your web page, you must analyze the assets that are critical to the initial view. the resources must then be minimized and optimized to reduce the overhead on the browser. this will ensure the progressive rendering of the page begins as fast as possible. the page will continue to load and draw all the other elements but this will not disrupt what the user views above the fold.

Published at DZone with permission of Kameerath Abdul Kareem, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Building Microservice in Golang
  • Stop Using Spring Profiles Per Environment
  • [DZone Survey] Share Your Expertise and Take our 2023 Web, Mobile, and Low-Code Apps Survey
  • 5 Steps for Getting Started in Deep Learning

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: