JavaScript can be a bottleneck


#1

Interesting talk you can view here

The Cost Of JavaScript - Addy Osmani - Fluent 2018

and while we are talking about performance and its cost
look this post too

How we spent $30k in Firebase in less than 72 hours
and some comments on hacker news

One thing I could say is that I’m glad I could program stuff for the Flash Player and Adobe AIR
and never have to deal with actually splitting the code for performance reasons.

I had to do things for perf, but not at the code level, it was either assets loading/pre-loading,
or assets compression/optimisation, but the code? nope all fine.

Sadly that’s what people overlook when they criticise Flash and/or AIR, it’s how good and fast the runtime is.

The AVM2 will starts much much much faster than a Java VM, and yeah the bytecode will execute “less fast”, but this fast start is quite important, exactly why when working with Redtamarin I can make it work as shell script, because it starts super damn fast.

See Flash Player ActionScript Virtual Machine
it is all explained there at 28:50

In the talk you can see when Adobe designed the AVM2 and ActionScript 3.0,
one of their constraint was “startup speed critical for interactive applications”,
and all that ended up in Adobe AIR :slight_smile:.


#2

There is also a medium post

The Cost Of JavaScript In 2018

Building interactive sites can involve sending JavaScript to your users. Often, too much of it. Have you been on a mobile page that looked like it had loaded only to tap on a link or tried to scroll and nothing happens?

Byte-for-byte, JavaScript is still the most expensive resource we send to mobile phones, because it can delay interactivity in large ways.

and let specially highlight this part

How to send less JavaScript
The shape of success is whatever let’s us send the least amount of script to users while still giving them a useful experience. Code-splitting is one option that makes this possible.

Code-splitting is this idea that, instead of shipping down your users a massive monolithic JavaScript bundle — sort of like a massive full pizza — what if you were to just send them one slice at a time? Just enough script needed to make the current page usable.

Code-splitting can be done at the page level, route level, or component level. It’s something that’s well supported by many modern libraries and frameworks through bundlers like webpack and Parcel. Guides to accomplish this are available for React, Vue.js and Angular.


Seriously … if you end up using code-splitting there is either a problem with the technology you use or a problem with what you want to do using that technology.