The State of JavaScript on Android in 2015 is... poor

Point of clarification: we know the performance gap comes down to the software, not the hardware. Chrome on desktop is much slower than Safari on desktop, on the same hardware. (People just care less about the gap on desktop, because both are “fast enough”.)

After much deep-diving into V8 internals, I am convinced it is because V8’s optimizing JIT compiler is way too aggressive. It constantly attempts optimizations that turn out to be bad and need to be backed out. Basically, V8 gambles hard on optimizations: if they turn out to be right, it is blazingly fast. If they turn out to be wrong, it’s worse than not trying to optimize at all.

This is why you will often see “(compiled code)” as the number 1 thing getting garbage collected in an Ember app on Chrome. V8 is constantly compiling functions, discovering they are overspecialized, and throwing them away.

10 Likes