Commit graph

2 commits

Author SHA1 Message Date
Douglas Katzman 78ef4a5081 Decode utf8 from C
This improves the benchmark result for long strings and does not
degrade it on short strings.

And fix the benchmark's randomizer. The hacky attempt to avoid the
surrogate pair range inadvertently prevented random strings from
containing any code point requiring exactly 2 encoding bytes.
2026-04-04 23:43:40 -04:00
Douglas Katzman b3478e055b Expose a much simplified utf8-to-string decoder
It comes in two-and-a-half variations: accepting a SAP or ub8 vector,
and if a SAP then either counted or null-terminated. In the case where
it returns base-string as determined by a pre-scan of the input, it runs
nearly twice as fast as octets-to-string
2026-04-04 21:22:33 -04:00