funny Math.random behaviour

Playing around with V8’s custom startup snapshots I noticed some funny behaviour regarding Math.random. It is clear that if you call Math.random() within the custom startup code the generated random numbers are baked into the snapshot and then not so random anymore. If you call Math.random() at runtime, without custom startup code, it just behaves as expected: it generates random numbers. However if you have custom startup code, calling Math.random() early on startup, it correctly generates random numbers during startup but it breaks runtime random number generation causing weird error messages like...

Planted: Mar 5, 2016 · 1 min

20x performance boost with V8Js snapshots

Recently @virgofx filed an issue on V8Js whether (startup) performance of V8Js could be increased. He wants to do server-side React rendering and noticed that V8 itself needs roughly 50ms to initialize and then further 60ms to process React & ReactServer javascript code. Way too much for server side rendering (on more or less every request). Up to V8 4.4 you simply could compile it with snapshots and V8Js made use of them....

Planted: Feb 29, 2016 · 2 min