Skip to content

benchmark: update iterations of benchmark/async_hooks/async-local- - #51420

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
lucshi:async_hooks/async-local-storage-getstore-nested-resources.js
Mar 4, 2024
Merged

benchmark: update iterations of benchmark/async_hooks/async-local-#51420
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
lucshi:async_hooks/async-local-storage-getstore-nested-resources.js

Conversation

@lucshi

@lucshilucshi commented Jan 10, 2024

Copy link
Copy Markdown

storage-getstore-nested-resources.js

Before applying this PR, the real logic code of "aync hooks" is not measured accurately.
After increasing the iteration value, the test case behavior made sense.

<style> </style>
after PRbefore PRbenefit
async_hooks/async-local-storage-getstore-nested-resources.jsresourceCount=10:247429210.512782754.531936%
async_hooks/async-local-storage-getstore-nested-resources.jsresourceCount=100:241176206.712875431.491873%
async_hooks/async-local-storage-getstore-nested-resources.jsresourceCount=1000:265273098.716031987.021655%

@nodejs-github-botnodejs-github-bot added async_hooks Issues and PRs related to the async hooks subsystem. benchmark Issues and PRs related to the benchmark subsystem. labels Jan 10, 2024
@lucshi

lucshi commented Mar 1, 2024

Copy link
Copy Markdown
Author

benchmark@benchmark-S2600WFT: v16.20.2/bin/node benchmark/async_hooks/async-local-storage-getstore-nested-resources.js

async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=10: 21,332,514.164789405
async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=100: 20,428,967.458697733
async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=1000: 19,337,123.4095216
benchmark@benchmark-S2600WFT: v20.10.0/bin/node benchmark/async_hooks/async-local-storage-getstore-nested-resources.js
async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=10: 13,379,304.62402147
async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=100: 13,310,421.660847794
async_hooks/async-local-storage-getstore-nested-resources.js n=10000 resourceCount=1000: 13,387,149.67502694

compared with node16, node21 performance downgraded by about 40%. Root cause is repetition is too small and only occupies about 1% of scoring period while 99% is occupied by GC. When the repetition is enlarged a lot, node21 downgration was fixed.

benchmark@benchmark-S2600WFT:~/luc/node_new$ /home/benchmark/.nvm/versions/node/v20.10.0/bin/node benchmark/async_hooks/async-local-storage-getstore-nested-resources.js
async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=10: 186,648,648.85043097
async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=100: 196,515,698.066993
async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=1000: 200,298,043.4887112
benchmark@benchmark-S2600WFT:~/luc/node_new$ /home/benchmark/.nvm/versions/node/v16.20.2/bin/node benchmark/async_hooks/async-local-storage-getstore-nested-resources.js async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=10: 172,352,994.0989782
async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=100: 175,277,771.4483027
async_hooks/async-local-storage-getstore-nested-resources.js n=500000 resourceCount=1000: 164,489,213.29086003

@legendecas

Copy link
Copy Markdown
Member

Would you mind rebasing on top of the main branch? One of the GitHub actions failed but I can not restart it.

@lucshi

Copy link
Copy Markdown
Author

sure I will rebase

@lucshi
lucshiforce-pushed the async_hooks/async-local-storage-getstore-nested-resources.js branch from 5156af6 to 13b615cCompareMarch 1, 2024 13:25
@legendecaslegendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 4, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 4, 2024
@nodejs-github-bot
nodejs-github-bot merged commit bf4a63e into nodejs:mainMar 4, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in bf4a63e

@lucshi
lucshi deleted the async_hooks/async-local-storage-getstore-nested-resources.js branch March 5, 2024 01:19
targos pushed a commit that referenced this pull request Mar 7, 2024
storage-getstore-nested-resources.js
Fixes: #50571
PR-URL: #51420
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@targostargos mentioned this pull request Mar 7, 2024
richardlau pushed a commit that referenced this pull request Mar 25, 2024
storage-getstore-nested-resources.js
Fixes: #50571
PR-URL: #51420
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
@richardlaurichardlau mentioned this pull request Mar 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

async_hooksIssues and PRs related to the async hooks subsystem.benchmarkIssues and PRs related to the benchmark subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@lucshi@legendecas@nodejs-github-bot@UlisesGascon