What is script-streaming?
How can web developers take advantage of script-streaming?
Two approaches to improve parsing
A practical technique, which was much easier to play with and needed no browser changes, was to reorder the position of
<script> tags in the HTML must be done with caution. It’s safer to reorder
|A||41||2.7 MB||12||1.3 MB|
|B||95||2.2 MB||19||1.1 MB|
Performance on MacBook Pro
Figures 1 and 2 below show the CDF distribution of page load times observed for the two test pages on a MacBook Pro. For page A, loading the page with reordered script tags in the HTML lead to a reduction of 6.2% in the median page load time. For page B, loading the page with reordered script tags reduced the median page load time by 4.5%.
Performance on Motorola Moto E
As shown in the figure below, loading page A with reordered script tag reduced the median page load time by 4.3%.
Loading page B (no graph shown) did not yield faster load times—perhaps the script-streaming thread was occupied when the mobile version of page A was loaded on Moto E device.
Performance on Motorola Moto G
As shown in the figure below, loading page A with reordered script tags reduced the median page load time by 3.5%.
For page B (no graph shown), the median page load time reduced by 1.9%.
Utkarsh Goel is an architect in Akamai’s Web Performance business unit who likes to build technologies to improve the current state of web performance. He is also a member of Akamai’s Foundry, the cutting-edge arm for applied R&D that believes in the “fail fast, succeed faster” philosophy and focuses on exploring new technology opportunities to improve all forms of Internet performance.