http://qs321.pair.com?node_id=11118989


in reply to Re^11: Modernizing the Postmodern Language?
in thread Modernizing the Postmodern Language?

I can't remember right now if Perl optimizes this in recent releases.

I don't think so - and same goes for raku, apparently.
On Ubuntu-20.04 (perl-5.32.0):
$ perl -le '$x = time;for (1..1000000000) {}; print time - $x;' 51
On Windows7 (perl-5.32.0):
C:\>perl -le "$x = time;for (1..1000000000) {}; print time - $x;" 13
The Windows box is about twice as fast as the Ubuntu box, so I'm not sure why the difference in this case is a factor of 4.

Anyway, thankfully perl has XS/Inline::C at hand to enable sane and efficient handling for cases such as these.

Cheers,
Rob