Repository navigation
Conversation
This was referenced Oct 18, 2026
This was referenced Oct 18, 2026
Contributor
Author
|
Most of this is JS-only optimization, which doesn’t fit the reference-runtime policy in #1644. Closing it; any C work needs its own measurements and a smaller patch. |
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.
Use the existing JS number/string representation instead of the Base call chain. The public APIs stay unchanged. The added Nat predicate intrinsics also emit direct C comparisons; the new number/string/map helpers are JS-only. The original nine text reports (#1673–#1681) and the earlier five additional reports linked below each include a compilable wrapper and a driver.
The walks compare numeric U32 Chars and respect packed non-scalars and astral scalars ending in low DC00; JS UTF-16 lexical order is not substituted. Case conversion and trimming stay ASCII-only. Nat.show retains the quotient-constructor overflow. from_list now reuses the fragment-join helper, with no new walker or empty/singleton array. U32.pow uses wrapping imul and arithmetic halving of its Nat exponent, not 32-bit truncation; log2 keeps zero at zero.
For the additional five, Linux x64/Bun 1.3.13, actual generated exports from main e5527d5 versus this change, seven warmed interleaved rounds including module conversion:
These are bounded local workloads, not a general speed guarantee. The earlier nine reports retain their original measurements.
Earlier checks (retained): 16,804 actual before/after and independent-oracle API assertions; first-class references; all 1,024 astral scalars with low DC00; frozen Char lists; numeric bounds and wide exponents. The packed-Char, string-kit, text, read-boundary and new sequence programs passed on emitted Bun and native C; the host-Nat fixture passed on Bun (11 runtime outcomes). Repository gate: 54/54, unchanged caps. No parser, kernel or CHANGELOG edits; no mini-cluster/GPU run claimed.
Fixes #1673.
Fixes #1674.
Fixes #1675.
Fixes #1676.
Fixes #1677.
Fixes #1678.
Fixes #1679.
Fixes #1680.
Fixes #1681.
Fixes #1685.
Fixes #1686.
Fixes #1687.
Fixes #1688.
Fixes #1689.
Five more cases in aa331df: logarithmic Nat.pow, direct Nat boolean comparisons, String.cmp without rebuilding its inputs, Map.bit without rebuilding the key, and the fuel-bounded U32 bit-width worker Map.msb.u. The two list-fold candidates were dropped after checking the maintainer decision on #802; no general continuation-passing change is proposed.
Same machine, generated exports from 0b82c20 versus this head, nine warmed alternating rounds:
Map.diff on short keys also improved (14.364 → 11.052 ms/100,000 calls); its separate long-prefix String walk did not. No application-wide speed or physical allocation claim.
Additional checks: 29,042 before/after dictionary oracle assertions, 10,491 arithmetic/string assertions on the final generated module, and 22 actual runtime outcomes across 12 existing/new programs on emitted Bun and native C. These include packed U32 Chars, both returned String.cmp inputs, zero/presence bits, wide Nat positions/fuel, valid largest-base powers and overflow. The host export fixture is JS-only. Repo gate 54/54, unchanged caps; no parser/kernel/CHANGELOG edits and no mini-cluster/GPU qualification claimed.
Fixes #1699.
Fixes #1700.
Fixes #1701.
Fixes #1702.
Fixes #1703.