perf(mojo): vendor one-pass float, 4-digit SWAR, and ctz scan - #146
Merged
Conversation
Vendor gld-json one-pass number parse, 4-digit SWAR, Ember ctz SIMD scan, digit-pair itoa, and skip of the short-dtoa exact search. n=1 encode cap is 1024 so list ensure does not resize. Decode lists are pre-sized to n. Official 2026-09-09-160305 vs #145: telemetry n=1 deser 1678→1233 (1.35× Ember), n=100 167450→106745 (1.48×). Telemetry n=1 ser 2020→1319 (1.27×), n=100 195051→117007 (1.53×). Message n=1 deser 406→348 (1.55× Ember). Fidelity 1.0. Version stays 0.2.0.
leo-gan
added a commit
that referenced
this pull request
Sep 9, 2026
Vendor gld-json SCAN_W = simd_width_of[uint8] (32 on AVX2) and inlined SWAR helpers. Official 2026-09-09-161131 vs #146: message n=1 ser 250→218, deser 348→331 (1.53× Ember). Document n=1 deser 1190→1048. Version stays 0.2.0.
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
count_trailing_zerosSIMD scan, digit-pair itoa, and skip of the short-dtoa exact searchensureresized mid-encode)nMeasure (official all-single
2026-09-09-160305vs #145)Fidelity 1.0. Strings deser is still heap-bound (32
Strings). Version stays 0.2.0.Validation
pixi run testinmojo/(roundtrip ok)./mojo/scripts/run-benchmarks.sh all-single jsonstem2026-09-09-160305