/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Perl program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 50,000 | 0.35 | 0.16 | ? | 527 | 73% 25% 80% 56% |
| 500,000 | 3.44 | 1.41 | 46,944 | 527 | 39% 57% 72% 79% |
| 5,000,000 | 34.56 | 13.84 | 140,296 | 527 | 36% 77% 59% 78% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read regex-dna benchmark to see what this program should do.
This is perl 5, version 18, subversion 0 (v5.18.0) built for i686-linux-thread-multi
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO
USE_PERL_ATOF USE_REENTRANT_API
# The Computer Language Benchmarks Game # http://benchmarksgame.alioth.debian.org/ # contributed by Danny Sauer # completely rewritten and # cleaned up for speed and fun by Mirco Wahab # improved STDIN read, regex clean up by Jake Berner # More speed and multithreading by Andrew Rodland use strict; use warnings; my $l_file = -s STDIN; my $content; read STDIN, $content, $l_file; # this is significantly faster than using <> in this case $content =~ s/^>.*//mg; $content =~ tr/\n//d; my $l_code = length $content; my @seq = ( 'agggtaaa|tttaccct', '[cgt]gggtaaa|tttaccc[acg]', 'a[act]ggtaaa|tttacc[agt]t', 'ag[act]gtaaa|tttac[agt]ct', 'agg[act]taaa|ttta[agt]cct', 'aggg[acg]aaa|ttt[cgt]ccct', 'agggt[cgt]aa|tt[acg]accct', 'agggta[cgt]a|t[acg]taccct', 'agggtaa[cgt]|[acg]ttaccct' ); my @procs; for my $s (@seq) { my $pat = qr/$s/; my $pid = open my $fh, '-|'; defined $pid or die "Error creating process"; unless ($pid) { my $cnt = 0; ++$cnt while $content =~ /$pat/gi; print "$s $cnt\n"; exit 0; } push @procs, $fh; } for my $proc (@procs) { print <$proc>; close $proc; } my %iub = ( B => '(c|g|t)', D => '(a|g|t)', H => '(a|c|t)', K => '(g|t)', M => '(a|c)', N => '(a|c|g|t)', R => '(a|g)', S => '(c|g)', V => '(a|c|g)', W => '(a|t)', Y => '(c|t)' ); # We could cheat here by using $& in the subst and doing it inside a string # eval to "hide" the fact that we're using $& from the rest of the code... but # it's only worth 0.4 seconds on my machine. my $findiub = '(['.(join '', keys %iub).'])'; $content =~ s/$findiub/$iub{$1}/g; printf "\n%d\n%d\n%d\n", $l_file, $l_code, length $content;
Wed, 22 May 2013 11:06:25 GMT COMMAND LINE: /usr/local/src/perl-5.18.0/bin/perl regexdna.perl-2.perl 0 < regexdna-input5000000.txt PROGRAM OUTPUT: agggtaaa|tttaccct 356 [cgt]gggtaaa|tttaccc[acg] 1250 a[act]ggtaaa|tttacc[agt]t 4252 ag[act]gtaaa|tttac[agt]ct 2894 agg[act]taaa|ttta[agt]cct 5435 aggg[acg]aaa|ttt[cgt]ccct 1537 agggt[cgt]aa|tt[acg]accct 1431 agggta[cgt]a|t[acg]taccct 1608 agggtaa[cgt]|[acg]ttaccct 2178 50833411 50000000 66800214