in reply to Why is "any" slow in this case?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why is "any" slow in this case?
by LanX (Saint) on Jul 28, 2025 at 08:40 UTC | |
by ysth (Canon) on Jul 28, 2025 at 16:22 UTC |