in reply to Re: Re: using s/// as map?
in thread how can I speed up this perl??
You can make it work like this though:
It's interesting that this is slightly faster than dropping the \G.++$count{$1},pos($genome)-- while $genome =~ /\G(..)/g
This however turns out to be a lot slower (seems to do a complete linear search for the proper string start every time):
$genome =~ /./g; $count{$1}++ while $genome =~ /(.\G.)/g
update This however means that the lookahead version can be speeded up by about 5% too:
$count{$1}++ while $genome =~ /\G(?=(..))./g
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3a: using s/// as map?
by Roy Johnson (Monsignor) on Nov 24, 2003 at 20:05 UTC |