substr() on utf8 strings is orders of magnitude slower since 5.36 · Issue #24531 · Perl/perl5
Description Since Perl 5.36.0, the UTF-8 position cache (${^UTF8CACHE}) is effectively never updated for character-to-byte offset conversions, at least in the common case where the character length...
github.com