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
$ time ruby -e 'x = "abc".b * 10_000_000' -e 'puts x.chars.length'30000000ruby -e 'x = "abc".b * 10_000_000' -e 'puts x.chars.length' 2.75s user 1.83s system 99% cpu 4.585 total
For cases where a String is ASCII compatible, this operation doesn't need to go through the iterator (and especially doesn't need to go through UTF-8 decoding). It should be quicker to do a copy and map over individual bytes to allocate the many String objects.
This probably requires a new API on spinoso_string::String and for the split between owned and borrowed encoded strings to land for binary and ascii encodings.
The text was updated successfully, but these errors were encountered:
For both ASCII-only UTF-8 Strings and Binary Strings.
On MRI these operations are twice as fast:
For cases where a String is ASCII compatible, this operation doesn't need to go through the iterator (and especially doesn't need to go through UTF-8 decoding). It should be quicker to do a copy and map over individual bytes to allocate the many
String
objects.This probably requires a new API on
spinoso_string::String
and for the split between owned and borrowed encoded strings to land for binary and ascii encodings.The text was updated successfully, but these errors were encountered: