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

Improve performance of seq/map peeks #1206

Merged
merged 3 commits into from
Oct 19, 2024
Merged

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Oct 19, 2024

Followup to #1205. Using the same benchmark shown in that PR, this improves performance from 235 MB/s to 255 MB/s (8%).

This matches how peeking is done within deserialize_any and other
Deserializer methods
We look at seq.first/map.first only once.
@dtolnay dtolnay merged commit f45b422 into serde-rs:master Oct 19, 2024
16 checks passed
@dtolnay dtolnay deleted the hasnext branch October 19, 2024 16:32
Finistere added a commit to grafbase/grafbase that referenced this pull request Oct 23, 2024
We're fixing dependency versions quite strictly for a reason that
escapes me. We miss updates like this one:
serde-rs/json#1206. So relaxed a few of those.
And fixed the benchmarks now that we're using `spawn_blocking` inside
the engine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant