[SR-11069] Slow case conversion of a longer ASCII String #53461
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
performance
standard library
Area: Standard library umbrella
Additional Detail from JIRA
md5: f06094738f2575f27454c6223b3d888a
Issue Description:
The case conversions:
uppercased()
andlowercased()
on longer string (6kB) are suspiciously slower if the string is composed of only ASCII characters.See new benchmarks:
AngryPhonebook.ASCII
vs.AngryPhonebook.Strasse
from PR #25309 .Non-ASCII string goes through ICU that incurs also UTF-8 -> UTF-16 transcoding but is still about 3-4x faster than the ASCII string case conversion.
Profiling these benchmarks in Instruments reveals that the heaviest stacktrace in the non-ASCII case of
AngryPhonebook.Strasse
looks like this:while the
AngryPhonebook.ASCII
looks like this:The text was updated successfully, but these errors were encountered: