DEV Community

Discussion on: Perl 7: A Modest Proposal

Collapse
 
fgasper profile image
Felipe Gasper

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 the length() of a downgraded string is just its SvCUR.

Collapse
 
grinnz profile image
Dan Book

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.)