Skip to content

Benchmark glazer with UTF-8 validation enabled#46

Merged
lpgauth merged 2 commits into
mainfrom
bench-glazer-validate-utf8
Jul 1, 2026
Merged

Benchmark glazer with UTF-8 validation enabled#46
lpgauth merged 2 commits into
mainfrom
bench-glazer-validate-utf8

Conversation

@lpgauth

@lpgauth lpgauth commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • The comparison benchmarks ran glazer with its defaults, which skip UTF-8 validation entirely — invalid bytes pass through decode silently and are copied verbatim on encode — while Torque always validates. The decode rows in particular compared validated parsing against unvalidated parsing.
  • Upgrade glazer to 0.5.15 (which added the validate_utf8 decode option) and pass validate_utf8 to all glazer decode calls and force_utf8 to all glazer encode calls in bench/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.
  • Apply the same options in bench/glazer_pgo_workload.exs so glazer's PGO profile matches the benchmarked configuration.
  • Document the configuration in the bench script header, on the CI dashboard page (Library Comparison section), and in the README benchmarks section.

lpgauth added 2 commits July 1, 2026 18:27
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.
@lpgauth lpgauth merged commit 5bdb111 into main Jul 1, 2026
4 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.

1 participant