for 1..10_000_000 { my ($a,$b,$c) = ... ... }

vs.

  for 1..10_000_000 {
     state ($a,$b,$c) = ...
     ...
  }

latter looks like it would run faster, because no reallocation envolved here.
I've read an advice somewhat like that in Ruby docs, tried it on perl5, and it really makes a difference, especially on very short loops.
could it be done some tricky optimisation, so if some variable in loop isn't going to have references on it, stored somewhere outside the block, than C<my> before it will be changed to C<state>?

Reply via email to