Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10x slowdown when compared to chrome? #78

Open
Alloyed opened this issue Nov 30, 2023 · 3 comments
Open

10x slowdown when compared to chrome? #78

Alloyed opened this issue Nov 30, 2023 · 3 comments

Comments

@Alloyed
Copy link

Alloyed commented Nov 30, 2023

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/cc525d0baf56697f856f389e35335b2b

$ ./d8.exe
V8 version 11.5.150.2
d8> load("nbody.js")
runNBody()...
runNBody(): 29.878999999999905 ms
undefined
d8>

Doing the same test in my locally installed copy of chrome:
https://jsfiddle.net/Lxtfun0b/

☁️ "Running fiddle"
"runNBody()..."
"runNBody(): 3.699999988079071 ms"

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.

@bnoordhuis
Copy link
Owner

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.

@dnets
Copy link

dnets commented Mar 21, 2024

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

@Daninet
Copy link

Daninet commented Jun 29, 2024

I had a look into the issue, and I realized that the TurboFan optimizing compiler of v8 is turned off. Here is my fix: #83
D8's performance now is similar to Chrome on my computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants