Thanks for the compare script. Indeed the lexical is a bit faster (probably what tobyink said about internal optimisations) and is confirmed by choroba but when I declare a lexical variable inside the loop for my $x (1,2,3) {my $z=12; $y+=$x } in predecl, it's 50% slower :(
I keep what you said about optimisation is a science
In reply to Re^2: declaring lexical variables in shortest scope: performance?
by bliako
in thread declaring lexical variables in shortest scope: performance?
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |