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): use opcall() directly #12310

Merged
merged 1 commit into from
Oct 3, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Oct 3, 2021

Instead of the wrapper dispatch() func, also now forbids passing opIds to opSync()/opAsync() callers must always pass names.

This is admittedly a micro-optimization, it shaves off ~10ns/iter for async ops and ~4ns/iter for sync ops (though on the scale of sync ops that's ~7%), it's half micro-optimization and half cleanup:

Before:
bench async:     393,383 ns/iter (+/- 6,025)
bench nop:      50,881 ns/iter (+/- 1,073)
bench sync:      57,920 ns/iter (+/- 669)

After:
bench async:     380,437 ns/iter (+/- 8,691)
bench nop:      46,860 ns/iter (+/- 1,470)
bench sync:      54,840 ns/iter (+/- 1,499)

Instead of the wrapper dispatch() func, also now forbids passing opIds to opSync()/opAsync() callers must always pass names

```
Before:
bench async:     393,383 ns/iter (+/- 6,025)
bench nop:      50,881 ns/iter (+/- 1,073)
bench sync:      57,920 ns/iter (+/- 669)

After:
bench async:     384,226 ns/iter (+/- 6,562)
bench nop:      47,125 ns/iter (+/- 2,046)
bench sync:      57,432 ns/iter (+/- 4,656)
```
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@AaronO AaronO merged commit 11acdf1 into denoland:main Oct 3, 2021
@AaronO AaronO deleted the perf/core-avoid-dispatch branch October 3, 2021 19:02
ry pushed a commit that referenced this pull request Oct 4, 2021
Instead of the wrapper dispatch() func, also now forbids passing opIds to opSync()/opAsync() callers must always pass names
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.

None yet

2 participants