Your site without JavaScript
There are plenty of reasons why the presence of script (what it does, how it works, and how heavy it is) needs to be considered a little more thoughtfully.
Web traffic today is made up of more than 50% mobile devices, of these devices, many operate under extremely volatile network connections—loading scripts-alone in less than 10 seconds is nigh on impossible in many situations.
If you’re working on a single page app, with no reasonable content-only-fallbacks, this can be far more damaging than you may think—users will be watching a white screen, with partial content, for a long time.
Performance is important, there’s no doubting that, but what common negative impacts does JavaScript have on our sites? How are we currently evaluating performance?
Let’s have a brief (but constructive) look at the cost of JavaScript.
When commonly auditing the performance impacts of JavaScript, we look at:
- The number of render-blocking scripts present on the page
- How long scripts take to download, and the amount of data transferred
But what we’re often missing is what happens thereafter—
Once the device has downloaded the scripts, they must be parsed, converted to bytecode, compiled and then executed.
Parse and compile time are two reasons why the same site that works great on your $3000 MacBook, feels kind of janky on a 2-year-old smartphone.
Ouch.
Let’s say, as an experiment, that we removed all scripts to establish a Performance baseline, to answer—“Just how fast could this be?”.
Calibre exists to make it trivial for teams to have better visibility to more areas of performance and user-experience, so in the spirit of that, you can now run a direct comparison of your site with, or without JS—as a Test profile.
I enabled the ability to disable scripts, and run a few test runs against popular global news sites, both with, and without JavaScript.
The results were rather staggering—below, The Guardian.
Time to visual completeness
Starting with the ‘non-js’ version (the left image) — all content is visible in under 5 seconds. On 3G. Impressive. 😤
However, the story is quite a bit different for the ‘with-js’ edition—the lead article image appears somewhere around the 9.5 second mark, with minor changes (weather, fonts, more fonts, and finally a ‘breaking news’ article) all the way up until around 20 seconds.
Data
With JavaScript, the Guardian delivered 3.41Mb over 115 requests, without, the data transferred is reduced by more than 50%—1.59MB, from 61 requests. A hefty tax for weather, fonts and a link to a breaking article.
Its clear that the data transferred isn’t all JS, it’s additional content, icons and perhaps even some styles—but the case is clear: this content is non-essential and is damaging the performance of this page.
How fast could your site be?
There we have it, a solid and repeatable performance baseline to answer the eternal question: “How fast could this be?”. What if we were able to apply these rules (within reason) until just the lightest, fastest possible experience was delivered to customers?
Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away.
—Antoine de Saint-Exupery
If you’re a Calibre customer and you’re interested in monitoring both with and without scripts, all you need to do is check the Disable JavaScript Execution checkbox. (Your Site→Settings→Test Profiles).
I’d love to hear how you’re planning on using Test Profiles; if you have any queries, ideas or thoughts, please share them!
If this article got your development team arguing about whether the web exists without JavaScript or not, I’m sorry. 😂
Start a free 14-day Calibre trial today.
We have so much more that we’re excited to share with you as we continue our mission to make the Web fast for everyone. 🌍🌏🌎