Skip to content

Improve performance of seq/map peeks#1206

Merged
dtolnay merged 3 commits into
serde-rs:masterfrom
dtolnay:hasnext
Oct 19, 2024
Merged

Improve performance of seq/map peeks#1206
dtolnay merged 3 commits into
serde-rs:masterfrom
dtolnay:hasnext

Conversation

@dtolnay
Copy link
Copy Markdown
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
@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
takumi-earth pushed a commit to earthlings-dev/json that referenced this pull request Jan 27, 2026
Improve performance of seq/map peeks
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