in reply to Re: Performance Tuning: Searching Long-Sequence Permutations
in thread Performance Tuning: Searching Long-Sequence Permutations

At a guess, this should be _much_ faster:
$bases{g} += $sub =~ y/G//;
Because there's no pattern't matching (as such), looping, or whatever involved.

edit: A quick benchmark shows that 5 transliterations is 100 times faster than the while loop for a $sub 10,000 characters long. That's better than I expected.

Also, although it's really a microoptimisation, I think it's always worthwhile remembering that ++$a is more efficient than $a++.

Jasper