How to debug random CPU spikes?

Thanks a lot for your explanation @KentonVarda so there is nothing to worry about after all!

It’s not a very large worker. The minimized js file is 153kB which should be reduced to less than 100kB with the final compression, way below the 1MB limit.

It may be way below the limit, but 153kB of JavaScript is still quite a bit of code and may indeed take several milliseconds for V8 to compile. So I think that’s a likely explanation here.

4 Likes

Duly noted!

Ohh, sweet lovely V8. Reminds me of https://web.archive.org/web/20181006134205/https://top.fse.guru/nodejs-a-quick-optimization-advice-7353b820c92e?gi=9146aa8d76d0

JavaScript insanity :smile:

1 Like

Lazy parsing is great, though, otherwise cold start time would be much longer!

I get your point, nonetheless, JavaScript (or better V8) is doing some hacks which would be unheard of on other platforms.