What portion of a "standard" web site (say, Google search) is hot vs non-hot ?
The specifics of this are a bit outside my knowledge area, so take this with a few major grains of salt.
But basically V8 has tools built in that will decide when the cost of compiling is worth the possible benefit.
So the AJAX submission javascript will probably never hit the optimizing compiler, but your function inside 3 nested loops will probably be hit ASAP.
Thanks :)
Kind of hilarious that we're worried about code size in browsers these days.
It's not disk size that we care about, it's memory size. Reducing the space that the "parsed" code takes up in memory will reduce the amount of memory used by the engine.
> It's not disk size that we care about, it's memory size.
Yeah, I get it. We have a lot of memory these days. Gigabytes. Not always enough for images and videos, but for code? for client-side browser code that is downloaded & run on the fly? Makes you wonder how we got there.
"Hot" or optimizable code will still be optimized and run just as fast.