The inefficiency is true and very important if you are using Unicode strings, because lowercasing Unicode characters is slow. Consider this modified benchmark:
use utf8;
use Benchmark 'cmpthese';
my $y = "HELLO ΑΙΝΣΪ" x 100;
# make sure your script is encoded in UTF-8 when you save it!
# ... the rest of the code is the same as in the parent node
Results:
Rate i_complex cc_complex complex complex_fail i_simple simple_fail simple cc_simple
i_complex 672/s -- -68% -70% -71% -98% -100% -100% -100%
cc_complex 2078/s 209% -- -9% -10% -94% -99% -100% -100%
complex 2278/s 239% 10% -- -2% -94% -99% -100% -100%
complex_fail 2317/s 245% 12% 2% -- -94% -99% -100% -100%
i_simple 35860/s 5234% 1626% 1474% 1448% -- -79% -95% -95%
simple_fail 168298/s 24935% 8001% 7289% 7164% 369% -- -76% -78%
simple 703114/s 104489% 33744% 30771% 30248% 1861% 318% -- -10%
cc_simple 780570/s 116011% 37472% 34172% 33591% 2077% 364% 11% --
Character classes are 3 times faster than /i for the complex case and 21 times faster for the simple case!