Operating on unicode is of course always slower. But only non-ascii strings are stored upgraded by use utf8. So the performance impact is necessary to get the correct length of such strings. (It's also cached in MG_LEN after the first access.)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Also, does
use utf8
slow Perl down by storing strings internally as upgraded?To get the
length()
of an upgraded string, Perl has to parse the individual characters. But thelength()
of a downgraded string is just its SvCUR.Operating on unicode is of course always slower. But only non-ascii strings are stored upgraded by
use utf8
. So the performance impact is necessary to get the correct length of such strings. (It's also cached in MG_LEN after the first access.)