in reply to Is foreach split Optimized? (Update: No.)

I also found several references to @x = split ... being optimized

That's just a normal call to `split`. It's actually the following that's optimized:

($x, $y, $z) = split ...;

It only finds and returns the first three items instead of all of them. Obviously, that optimization can't be used for

@a = split ...;

This post lists the for optimizations.

Replies are listed 'Best First'.
Re^2: Is foreach split Optimized?
by haukex (Archbishop) on Jul 11, 2017 at 10:37 UTC

    Thank you for the link! Taken together with the AM's post here, it does seem that I was just surprised by the speed of split, causing me to initially read too much into the commit messages regarding @x = split, like 692044df and 5012eebe.