I know that it is well-known that tr is faster than m//
Except when it is not.
Quite impressive difference, isn't it?No. The difference is 1/18982.5th of second which isn't impressive at all. q-: The quotient looks impressive but benchmark has to go to a lot of work to be able to guess at that so you won't see a quotient anything close to that in practice.
Congratulations, you've now prematurely optimized this nano-operation.
I find that the difference is usually more indicative of the practical value of the optmization than the quotient.
- tye (cheap philosophy shouldn't cost a lot)In reply to Re^2: counting regex hits Benchamark (except)
by tye
in thread counting regex hits
by Becky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |