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(webidl): optimize createDictionaryConverter() #12279

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Sep 30, 2021

On a benchmark constructing Responses with headers this shaves off 25%:

Before:
resp_w_h:            	n = 1000000, dt = 2.284s, r = 437828/s, t = 2283ns/op
After:
resp_w_h:            	n = 1000000, dt = 1.725s, r = 579710/s, t = 1725ns/op

On a benchmark constructing `Response`s with headers this shaves off 25%:
```
Before:
resp_w_h:            	n = 1000000, dt = 2.284s, r = 437828/s, t = 2283ns/op
After:
resp_w_h:            	n = 1000000, dt = 1.725s, r = 579710/s, t = 1725ns/op
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

V8 is soooo weird...

@AaronO AaronO merged commit 7283647 into denoland:main Sep 30, 2021
@AaronO AaronO deleted the perf/webidl-creat-dict-converter branch September 30, 2021 19:33
ry pushed a commit that referenced this pull request Oct 4, 2021
On a benchmark constructing Responses with headers this shaves off 25%
@kurtextrem
Copy link

Interesting, if I micro-benchmark this in V8 9.6.11 (Chrome v96), I get a majorly faster spread operation: https://esbench.com/bench/615c7bcb6c89f600a5701202

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.

3 participants