Open Alloyed opened 9 months ago
Could be, or it's just differences in V8 versions. They tweak their heuristics continually and micro benchmarks that complete in under a second are unlikely to reach a JIT steady state.
Use https://github.com/v8/web-tooling-benchmark/ for something more representative.
Noticed this too. This is really bad compared to Chrome. @Alloyed have you managed to investigate? I've used simple for(i=0; i<100000000; i++) {let b = new Object()} And it's around 2800ms for v8-cmake's d8 vs Chrome's 150ms
I had a look into the issue, and I realized that the TurboFan optimizing compiler of v8 is turned off. Here is my fix: https://github.com/bnoordhuis/v8-cmake/pull/83 D8's performance now is similar to Chrome on my computer.
using this test on my local machine, with a locally built copy of d8.exe (on windows MSVC,
cmake --build . --config Release
): https://gist.github.com/Alloyed/cc525d0baf56697f856f389e35335b2bDoing the same test in my locally installed copy of chrome: https://jsfiddle.net/Lxtfun0b/
My first guess is that the currently used gn build flags are not the same as chrome uses in production, but just wanted to flag this before I start investigating.