You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS String.cmp rebuilds both input strings while finding their order #1701
String.cmp returns both original strings along with their order, but its JS Base path recursively reconstructs those strings even though the host representation is immutable text.
For an exported wrapper returning (String & String) & Cmp, I compared two strings with a 256-character common prefix, 100 calls per round. Nine warmed alternating rounds: median 4.771 ms before, 0.140 ms after, with the same LT results and both returned texts unchanged. Linux x64/Bun 1.3.13, existing #1682 head 0b82c20 versus the patch.
The lowering reuses string_compare already in that PR and returns the two original host strings. It does not substitute JS UTF-16 lexical order: full U32 Chars, packed non-scalars and astral characters still use numeric Char order. The updated runtime fixture checks both returned strings through their Char codes, including U+0000, a surrogate, U+10000 and U32 max.
Patch: oxura@aa331dfd
Included in existing PR #1682; the earlier String.order/eq reports are not being counted again.
Activity