There's another possible micro optimization. You could change the last line of the second group to just return 7200000 as you already know v is less then 64800000. There's no point testing it again.
# replace elsif( $v < 64800000 ) { return 7200000; } #with else { return 7200000; }
BTW that's an interesting result that elsif is quicker, did you test them in isolation? What improvement did the partial binary chop make compared with the elsif?
In reply to Re^2: A better way of lookup?
by RichardK
in thread A better way of lookup?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |