/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one core |
Each table row shows performance measurements for this C# Mono program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 50,000 | 1.51 | 1.52 | 21,304 | 624 | 1% 0% 0% 100% |
| 500,000 | 7.75 | 7.77 | 196,852 | 624 | 0% 0% 1% 100% |
| 5,000,000 | Failed | 624 |
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.
Mono JIT compiler version 3.0.3 (tarball Tue Feb 12 10:56:44 PST 2013)
LLVM: yes(3.2svn-mono)
/* The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/ * * contributed by Isaac Gouy */ using System; using System.Text.RegularExpressions; class regexdna { static void Main(string[] args){ // read FASTA sequence String sequence = Console.In.ReadToEnd(); int initialLength = sequence.Length; // remove FASTA sequence descriptions and new-lines Regex r = new Regex(">.*\n|\n", RegexOptions.Compiled); sequence = r.Replace(sequence,""); int codeLength = sequence.Length; // regex match string[] variants = { "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" }; int count; foreach (string v in variants){ count = 0; r = new Regex(v, RegexOptions.Compiled); for (Match m = r.Match(sequence); m.Success; m = m.NextMatch()) count++; Console.WriteLine("{0} {1}", v, count); } // regex substitution IUB[] codes = { new IUB("B", "(c|g|t)") ,new IUB("D", "(a|g|t)") ,new IUB("H", "(a|c|t)") ,new IUB("K", "(g|t)") ,new IUB("M", "(a|c)") ,new IUB("N", "(a|c|g|t)") ,new IUB("R", "(a|g)") ,new IUB("S", "(c|g)") ,new IUB("V", "(a|c|g)") ,new IUB("W", "(a|t)") ,new IUB("Y", "(c|t)") }; foreach (IUB iub in codes) { r = new Regex(iub.code, RegexOptions.Compiled); sequence = r.Replace(sequence,iub.alternatives); } Console.WriteLine("\n{0}\n{1}\n{2}", initialLength, codeLength, sequence.Length); } struct IUB { public string code; public string alternatives; public IUB(string code, string alternatives) { this.code = code; this.alternatives = alternatives; } } }
Tue, 12 Feb 2013 21:22:43 GMT MAKE: mv regexdna.csharp regexdna.cs /usr/local/bin/mcs -optimize+ -platform:x86 -out:regexdna.csharp_run regexdna.cs rm regexdna.cs 0.23s to complete and log all make actions COMMAND LINE: /usr/local/bin/mono --llvm regexdna.csharp_run 0 < regexdna-input5000000.txt PROGRAM FAILED 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 <premain>: CommandLine Error: Argument 'misched' defined more than once! <premain>: CommandLine Error: Argument 'print-machineinstrs' defined more than once! -simplifycfg: CommandLine Error: Argument 'misched' defined more than once! -simplifycfg: CommandLine Error: Argument 'print-machineinstrs' defined more than once! Unhandled Exception: OutOfMemoryException [ERROR] FATAL UNHANDLED EXCEPTION: System.OutOfMemoryException: Out of memory at (wrapper managed-to-native) object:__icall_wrapper_mono_string_alloc (intptr) at (wrapper alloc) object:Alloc (intptr,int) at System.Text.StringBuilder.InternalEnsureCapacity (Int32 size) [0x00000] in <filename unknown>:0 at System.Text.StringBuilder.Append (System.String value, Int32 startIndex, Int32 count) [0x00000] in <filename unknown>:0 at System.Text.RegularExpressions.BaseMachine.LTRReplace (System.Text.RegularExpressions.Regex regex, System.String input, System.Text.RegularExpressions.MatchAppendEvaluator evaluator, Int32 count, Int32 startat, Boolean needs_groups_or_captures) [0x00000] in <filename unknown>:0 at System.Text.RegularExpressions.BaseMachine.Replace (System.Text.RegularExpressions.Regex regex, System.String input, System.String replacement, Int32 count, Int32 startat) [0x00000] in <filename unknown>:0 at System.Text.RegularExpressions.Regex.Replace (System.String input, System.String replacement, Int32 count, Int32 startat) [0x00000] in <filename unknown>:0 at System.Text.RegularExpressions.Regex.Replace (System.String input, System.String replacement) [0x00000] in <filename unknown>:0 at regexdna.Main (System.String[] args) [0x00000] in <filename unknown>:0