|
|
| XP is just a number | |
| PerlMonks |
Re: Why is "any" slow in this case?by Anonymous Monk |
| on Jul 28, 2025 at 06:15 UTC ( [id://11165816]=note: print w/replies, xml ) | Need Help?? |
|
Generally speaking: Sub routines and iteration are slower than operations. So ugly is always going to be faster than any, unless the ugly operation gets absurdly large, probably 100's of numbers. Secondly, every time you access $1 or $2, there is a check of the regexp context, its not just taking some already known value, which adds overhead. So _cr of assigning $1/$2 to a local variable should always end up faster compared to even 2 or 3 uses of $1/$2.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||