Re:Counting the number of matching characters in two ASCII s...
by sfink on Friday May 21, 2021 @05:28PM
(#27240185)
Yes! Plain ASCII is great, even when you need to properly handle non-ASCII. When >90% of your strings are ASCII in practice, then having an "is ASCII" bit in your string headers can save a ton of memory, and gain more performance than you lose in flag checks and extra code.
Heck, if your usual encoding is UTF-8, the flag bit can be purely advisory and ignored when it doesn't matter.
Heck, if your usual encoding is UTF-8, the flag bit can be purely advisory and ignored when it doesn't matter.