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(serde_v8): drop need for EscapableHandleScope #9990

Merged
merged 2 commits into from
Apr 4, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Apr 3, 2021

This is another improvement to serde_v8's serialization code, it drops the need for creating a v8::EscapableHandleScope or "subscope". It's a simplication and optimization similar in nature to #9987.

This is very exciting since sub 100ns/op for sync-ops appears to be within reach ! (at least on my machine, M1 Air)

Benches

Using our trusty op_baseline bench to compare with main:
(Note that the before and after of these benches integrates changes from #9983)

Before:
test bench_op_async   ... bench:     647,272 ns/iter (+/- 57,528)
test bench_op_nop     ... bench:     157,173 ns/iter (+/- 2,096)
test bench_op_pi_bin  ... bench:     179,239 ns/iter (+/- 4,354)
test bench_op_pi_json ... bench:     175,075 ns/iter (+/- 1,814)

After:
test bench_op_async   ... bench:     564,882 ns/iter (+/- 12,229)
test bench_op_nop     ... bench:     114,117 ns/iter (+/- 2,489)
test bench_op_pi_bin  ... bench:     139,160 ns/iter (+/- 6,047)
test bench_op_pi_json ... bench:     129,266 ns/iter (+/- 2,938)

@AaronO AaronO changed the title perf(serde_v8/ser): drop need for EscapableHandleScope perf(serde_v8): drop need for EscapableHandleScope Apr 3, 2021
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 🚀

@bartlomieju bartlomieju merged commit 84e1df3 into denoland:main Apr 4, 2021
@AaronO AaronO deleted the serde-v8/drop-escapable-scope branch April 4, 2021 00:14
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