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/de): implement SeqAccess size_hint #9975

Merged
merged 2 commits into from
Apr 3, 2021

Conversation

AaronO
Copy link
Contributor

@AaronO AaronO commented Apr 2, 2021

So serde can optimize array allocation. Array deserialization on serde_v8's benches are 33% faster as a result.

Benches

Before:
test de_array_json        ... bench:         472 ns/iter (+/- 17)
test de_array_v8          ... bench:         578 ns/iter (+/- 15)

After:
test de_array_json        ... bench:         469 ns/iter (+/- 12)
test de_array_v8          ... bench:         386 ns/iter (+/- 8)

So serde can optimize array allocation
@AaronO AaronO changed the title serde_v8/de: implement SeqAccess::size_hint perf(serde_v8/de): implement SeqAccess size_hint Apr 2, 2021
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

@ry ry merged commit 105c0ee into denoland:main Apr 3, 2021
@AaronO AaronO deleted the perf/serde-v8-de-array-size-hint branch April 3, 2021 09:24
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