in reply to Re: Performance Tuning: Searching Long-Sequence Permutations
in thread Performance Tuning: Searching Long-Sequence Permutations
$permutations_total++ while $string =~ $promoters_regex[$j];
I guess you want:
$permutations_total++ while $string =~ /$promoters_regex[$j]/g;
here, otherwise you'll never terminate once there's a match. But now, qr will actually be slower, because you're are interpolating the compiled regex, and recompiling it. And if there are many matches, some gain could be made by writing it as:
{ no warnings 'numeric'; $permutations_total += $string =~ /$promoters_regex[$j]/g; }
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Performance Tuning: Searching Long-Sequence Permutations
by chip (Curate) on Jun 27, 2003 at 02:40 UTC | |
|
Re: Re: Performance Tuning: Searching Long-Sequence Permutations
by diotalevi (Canon) on Jun 27, 2003 at 04:09 UTC | |
|
Re: Re: Performance Tuning: Searching Long-Sequence Permutations
by Jasper (Chaplain) on Jun 27, 2003 at 13:17 UTC | |
by Abigail-II (Bishop) on Jun 27, 2003 at 13:23 UTC | |
by diotalevi (Canon) on Jun 27, 2003 at 13:25 UTC |