Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^2: declaring lexical variables in shortest scope: performance?by bliako (Monsignor) |
on Mar 31, 2020 at 11:05 UTC ( [id://11114844]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|