in reply to Re^2: Removing Flanking "N"s in a DNA String
in thread Removing Flanking "N"s in a DNA String
Really, then what is wrong with my benchmark?
#! perl -slw use strict; use Benchmark qw[cmpthese]; my @tests = map{ my $s = 'N' x $_; ( "${s}S${s}S", "${s}S${s}S${s}", "S${s}S${s}" ) } map{ $_ * 10 } 1 .. 100; @$_ = @tests for \ our( @a, @b, @c, @d ); cmpthese 10, { a=>q[ s[^N*(.*?)N*$][$1] for @a ], b=>q[ s[N*$][] and s[^n*][] for @b ], c=>q[ s[N*$][] and s[^n*][] for @c ], d=>q[ s[^N*(.*?)N*$][$1] for @d ], }; __END__ P:\test>junk Rate b c a d b 6.10/s -- -1% -27% -28% c 6.15/s 1% -- -26% -27% a 8.31/s 36% 35% -- -1% d 8.42/s 38% 37% 1% --
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Removing Flanking "N"s in a DNA String
by Aristotle (Chancellor) on Nov 07, 2005 at 16:10 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 16:25 UTC | |
by Perl Mouse (Chaplain) on Nov 07, 2005 at 16:35 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 16:56 UTC |