🏎️ The History Of Javascript Performance Vol 1
From handling an input to running a game, Javascript went a long road to answer the question who runs the Web.
Javascript performance improved significantly during last years. From this article you will learn about several ways browser Javascript engines developers boosted Javascript performance.
#1 Faster Revisits With JavaScript Startup Bytecode Cache
Firefox relies on a Javascript engine called SpiderMoney. In 2017 it was modified to significantly improved repetitive startups of a website.
Usually, when you visit a page, the browser caches Javascript code. Thanks to that, when revisiting, browser can utilize the cached version of Javascript code rather than downloading it again from the Internet.
With current Internet speeds it may not sound like an expective task. But we have to take into account it’s not trivial. It may involve resolving a domain, making a SSL handshake, negotiating CORS with preflights and downloading actual Javascript code.
All of the network activities come with a latency penalty dependant on the network routing quality adding from 10-1000ms to the whole process.