Benchmark glazer with UTF-8 validation enabled#46
Merged
Conversation
The comparison benchmarks ran glazer with its defaults, which skip UTF-8 validation on both decode and encode, while Torque always validates. The decode rows in particular compared validated against unvalidated parsing. Upgrade glazer to 0.5.15 (adds the validate_utf8 decode option) and pass validate_utf8 to decode and force_utf8 to encode in the benchmark and in the glazer PGO workload, so every library in the comparison provides the same guarantee: JSON strings are valid UTF-8. Document the configuration in the bench script, the CI dashboard page, and the README.
Re-run of the full suite on Apple M2 Pro (OTP 29, Elixir 1.20), PGO builds for both torque and glazer, with glazer now paying for UTF-8 validation like every other library in the comparison (validate_utf8 on decode, force_utf8 on encode). Torque now leads glazer on every decode, encode, and extraction row.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
validate_utf8decode option) and passvalidate_utf8to all glazer decode calls andforce_utf8to all glazer encode calls inbench/torque_bench.exs, so every library in the comparison provides the same guarantee: JSON strings are valid UTF-8. Verified against 0.5.15: invalid UTF-8 now raises{:parse_error, "invalid UTF-8 in JSON string at offset N"}with the option and passes through without it.bench/glazer_pgo_workload.exsso glazer's PGO profile matches the benchmarked configuration.