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

bench: Avoid allocating an extra hash when not necessary #949

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

byroot
Copy link
Contributor

@byroot byroot commented Jan 3, 2025

JSON.parse(@json, symbolize_names: @symbolize) allocates an extra hash, which isn't necessary when symbolize is false.

In the grand scheme of things, it's not a big deal, but on this sort of micro-benchmarks that can easily accound for a huge part of the runtime just because of the increased GC pressure.

`JSON.parse(@JSON, symbolize_names: @Symbolize)` allocates an extra hash,
which isn't necessary when `symbolize` is `false`.

In the grand scheme of things, it's not a big deal, but on this sort
of micro-benchmarks that can easily accound for a huge part of the runtime
just because of the increased GC pressure.
@ohler55 ohler55 merged commit 562e68a into ohler55:develop Jan 3, 2025
53 checks passed
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.

2 participants