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

perf(core): speed up promise hook dispatch #17616

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

piscisaureus
Copy link
Member

No description provided.

@piscisaureus piscisaureus force-pushed the promise_hook_perf branch 4 times, most recently from 81e2eb1 to 1abc19f Compare February 1, 2023 20:24
core/01_core.js Outdated Show resolved Hide resolved
@bartlomieju
Copy link
Member

Results on v1.30:

no hooks:
Iterations per second: 20746888
Iterations per second: 23201856
Iterations per second: 23310023

noop hooks:
Iterations per second: 9578544
Iterations per second: 9861933
Iterations per second: 9910803

AsyncLocalStorage:
Iterations per second: 2314815
Iterations per second: 2361833
Iterations per second: 2345766

This PR:

no hooks:
Iterations per second: 22075055
Iterations per second: 24570025
Iterations per second: 24630542

noop hooks:
Iterations per second: 10152284
Iterations per second: 8496177
Iterations per second: 10405827

AsyncLocalStorage:
Iterations per second: 2405581
Iterations per second: 2427774
Iterations per second: 2433682

Not much perf gain, but better than nothing

core/01_core.js Outdated Show resolved Hide resolved
core/01_core.js Outdated Show resolved Hide resolved
@piscisaureus
Copy link
Member Author

a bit disappointing indeed

@piscisaureus piscisaureus force-pushed the promise_hook_perf branch 2 times, most recently from ee8a40b to 9e0876b Compare February 10, 2023 09:04
@piscisaureus piscisaureus enabled auto-merge (squash) February 10, 2023 09:15
@piscisaureus
Copy link
Member Author

With the latest version of this patch, I get the following benchmark results.
The benchmark installs two hooks (init and before) and performs minimalistic async context forwarding.

deno 1.30.3 (release, aarch64-apple-darwin)

piscisaureus@dumbo:~/Desktop/async_context 🦕 deno run bench.js
Iterations per second: 8992806
Iterations per second: 9157509
Iterations per second: 9208103
Iterations per second: 9523810
Iterations per second: 9478673
Iterations per second: 9551098

This PR

piscisaureus@dumbo:~/Desktop/async_context 🦕 ~/d/deno/target/release/deno run bench.js
Iterations per second: 10515247
Iterations per second: 10905125
Iterations per second: 10989011
Iterations per second: 11467890
Iterations per second: 11494253
Iterations per second: 11520737

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@piscisaureus piscisaureus merged commit c83abb8 into denoland:main Feb 10, 2023
This pull request was closed.
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

Successfully merging this pull request may close these issues.

2 participants