Speed have always been one of Chrome's primary missions, ever since it is included as one of the founding principles in 20 But the speed is on the more than just traditional Javascript benchmarks. Ideally every part of a user's interaction with a browser are fast, starting with loading Web pages. Chrome is introducing the techniques called script streaming and code caching designed to reduce that painful waiting time Spent staring at a white screen, especially on mobile devices.
Speed has been a top priority for Chrome, and in 2008 it has been identified as a basic principle. Chrome introduces two techniques: script flow and code caching. To reduce the waiting time.
Script Streaming optimizes the parsing of JavaScript files. Previous versions of Chrome would download a script in full before beginning to parse it, which is a straightforward appro Ach but doesn ' t fully utilize the CPU while waiting for the download to complete. Starting in version $, Chrome parses async and deferred scripts on a separate thread as soon as the download have begun. This means is parsing can complete just milliseconds after the download have finished, and results in pages loading as Mu Ch as 10% faster. It ' s particularly effective on large scripts and slow network connections.
The script stream optimizes the parsing of the JS file. Starting with version 42, at the beginning of the download, Chrome parses asynchronous and deferred scripts on a separate thread. This means that when the download is completed for 1 per thousand seconds, the parsing is complete.
Code caching is another new technique this helps speed up page loading, specifically on repeated visits to the same page. Normally, the V8 engine compiles the page ' s JavaScript on every visit, turning it into instructions, a processor under Stands. This compiled code was then discarded once a user navigates away from the page as compiled code was highly dependent on the State and context of the machine at compilation time. Chrome introduces an advanced technique of storing a local copy of the compiled code, so that's when the user returns to The page the downloading, parsing, and compiling steps can all be skipped. Across All page loads, this allows Chrome to avoid about 40% of compile time and saves precious battery on mobile devices.
Code caching can also improve page loading speed, especially when repeatedly accessing the same page.
New JavaScript techniques for rapid page loads to speed up the loading of the latest JS technology