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

Performance regression between 8.9 and 8.10 #19444

Closed
delvedor opened this issue Mar 19, 2018 · 4 comments
Closed

Performance regression between 8.9 and 8.10 #19444

delvedor opened this issue Mar 19, 2018 · 4 comments
Labels
performance Issues and PRs related to the performance of Node.js. v8 engine Issues and PRs related to the V8 dependency.

Comments

@delvedor
Copy link
Member

  • Version v8.10.0:
  • Platform MacOS:
  • Subsystem:

Hello everybody!
I think I've found a performances regression in v8.10.0.
I'm the author of find-my-way, an http router. During a performances test I've noticed that I've got a regression between v8.9.0 and v8.10.0.

To verify the issue by yourself clone the project and do the following:

nvm use v8.10.0
git checkout v1.10.4
node bench.js

then

nvm use v8.9.0
node bench.js

As you can see under v8.9.0 the performances are way better.

My results
~/Development/find-my-way  cc6ac4e ✔                                                                                                                                                                             
▶ node -v
v8.10.0

~/Development/find-my-way  cc6ac4e ✔                                                                                                                                                                             
▶ node bench.js
lookup static route x 26,119,612 ops/sec ±1.03% (86 runs sampled)
lookup dynamic route x 1,302,000 ops/sec ±0.87% (89 runs sampled)
lookup dynamic multi-parametric route x 715,705 ops/sec ±0.94% (90 runs sampled)
lookup dynamic multi-parametric route with regex x 711,020 ops/sec ±0.64% (93 runs sampled)
lookup long static route x 1,678,087 ops/sec ±1.14% (91 runs sampled)
find static route x 28,763,239 ops/sec ±0.62% (92 runs sampled)
find dynamic route x 1,552,819 ops/sec ±0.72% (93 runs sampled)
find dynamic multi-parametric route x 836,996 ops/sec ±0.84% (89 runs sampled)
find dynamic multi-parametric route with regex x 806,364 ops/sec ±0.68% (91 runs sampled)
find long static route x 2,684,363 ops/sec ±0.72% (93 runs sampled)
~/Development/find-my-way  cc6ac4e ✔                                                                                                                                                                           
▶ node -v
v8.9.0

~/Development/find-my-way  cc6ac4e ✔                                                                                                                                                                           
▶ node bench.js
lookup static route x 31,258,395 ops/sec ±0.95% (93 runs sampled)
lookup dynamic route x 1,493,612 ops/sec ±0.93% (92 runs sampled)
lookup dynamic multi-parametric route x 821,517 ops/sec ±0.94% (90 runs sampled)
lookup dynamic multi-parametric route with regex x 752,734 ops/sec ±0.44% (93 runs sampled)
lookup long static route x 2,332,910 ops/sec ±0.93% (88 runs sampled)
find static route x 30,914,105 ops/sec ±0.79% (92 runs sampled)
find dynamic route x 1,648,165 ops/sec ±0.94% (91 runs sampled)
find dynamic multi-parametric route x 876,395 ops/sec ±0.84% (91 runs sampled)
find dynamic multi-parametric route with regex x 803,478 ops/sec ±0.64% (93 runs sampled)
find long static route x 2,769,465 ops/sec ±0.68% (94 runs sampled)

Please let me know if I can do something more, thanks!

cc @mcollina

@mcollina
Copy link
Member

cc @nodejs/v8

@bmeurer
Copy link
Member

bmeurer commented Mar 19, 2018

Interesting, I can reproduce it. May be related to webpack/webpack#6767. At least it's fixed on V8 ToT (Node 10):

$ node -v
v8.9.4
$ node bench.js
lookup static route x 25,427,565 ops/sec ±0.52% (91 runs sampled)
lookup dynamic route x 1,924,493 ops/sec ±0.49% (96 runs sampled)
lookup dynamic multi-parametric route x 1,061,297 ops/sec ±0.71% (94 runs sampled)
lookup dynamic multi-parametric route with regex x 929,959 ops/sec ±0.29% (94 runs sampled)
lookup long static route x 2,372,058 ops/sec ±0.48% (93 runs sampled)
find static route x 20,464,729 ops/sec ±0.22% (92 runs sampled)
find dynamic route x 2,131,898 ops/sec ±0.54% (92 runs sampled)
find dynamic multi-parametric route x 1,195,682 ops/sec ±0.17% (94 runs sampled)
find dynamic multi-parametric route with regex x 1,010,835 ops/sec ±0.61% (95 runs sampled)
find long static route x 2,797,766 ops/sec ±0.11% (95 runs sampled)

$ node -v
v8.10.0
$ node bench.js
lookup static route x 22,838,987 ops/sec ±0.55% (94 runs sampled)
lookup dynamic route x 1,656,395 ops/sec ±0.40% (96 runs sampled)
lookup dynamic multi-parametric route x 906,867 ops/sec ±0.67% (96 runs sampled)
lookup dynamic multi-parametric route with regex x 810,267 ops/sec ±0.58% (93 runs sampled)
lookup long static route x 1,753,420 ops/sec ±0.57% (95 runs sampled)
find static route x 21,688,548 ops/sec ±0.36% (89 runs sampled)
find dynamic route x 1,986,447 ops/sec ±0.56% (96 runs sampled)
find dynamic multi-parametric route x 1,096,209 ops/sec ±0.30% (94 runs sampled)
find dynamic multi-parametric route with regex x 1,015,034 ops/sec ±0.73% (95 runs sampled)
find long static route x 2,842,425 ops/sec ±0.21% (96 runs sampled)

$ ~/Applications/node-vee-eight-lkgr/bin/node -v
v10.0.0-pre
$ ~/Applications/node-vee-eight-lkgr/bin/node bench.js
lookup static route x 31,882,642 ops/sec ±0.45% (93 runs sampled)
lookup dynamic route x 1,865,270 ops/sec ±0.76% (94 runs sampled)
lookup dynamic multi-parametric route x 1,093,917 ops/sec ±0.66% (96 runs sampled)
lookup dynamic multi-parametric route with regex x 1,040,858 ops/sec ±0.24% (94 runs sampled)
lookup long static route x 2,695,603 ops/sec ±0.23% (96 runs sampled)
find static route x 27,876,935 ops/sec ±0.24% (93 runs sampled)
find dynamic route x 2,201,909 ops/sec ±0.15% (96 runs sampled)
find dynamic multi-parametric route x 1,239,351 ops/sec ±0.56% (95 runs sampled)
find dynamic multi-parametric route with regex x 1,132,907 ops/sec ±0.19% (93 runs sampled)
find long static route x 3,850,723 ops/sec ±0.21% (97 runs sampled)

@hashseed
Copy link
Member

hashseed commented Mar 19, 2018

Would anyone be willing to bisect the V8 change between Node 8.9 and 8.10 that caused this regression? I posted instructions to do that here.

@trivikr trivikr added v8 engine Issues and PRs related to the V8 dependency. performance Issues and PRs related to the performance of Node.js. labels Apr 4, 2018
@targos targos added the v8.x label Nov 4, 2018
@apapirovski
Copy link
Member

Given the lack of a movement here for over 6 months, I'm going to close this out — especially since this is an issue with V8. Do feel free to reopen if you feel strongly about this but at this point it might need some actionable input to push this forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and PRs related to the performance of Node.js. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

No branches or pull requests

7 participants