/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this F# Mono program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 50,000 | 2.78 | 2.56 | 37,084 | 639 | 61% 35% 15% 1% |
| 500,000 | 9.34 | 5.19 | 139,492 | 639 | 59% 67% 41% 15% |
| 5,000,000 | 75.94 | 23.99 | 1,042,024 | 639 | 75% 76% 75% 92% |
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.
Microsoft (R) F# 3.0 Compiler version (Mono build)
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/ // // Modified version of Valentin Kraevskiy // Contributed by Vassil Keremidchiev open System.Text.RegularExpressions open System.Threading let regex s = Regex (s, RegexOptions.Compiled) let input = stdin.ReadToEnd () let withoutComments = (regex ">.*\n").Replace (input, "") let text = (regex "\n").Replace (withoutComments, "") let rec onblocks res s = let size = 1024*4096 match s with | "" -> res | s when (s.Length < size) -> res @ [s] | s -> onblocks (res @ [s.Substring(0, size)]) (s.Substring(size)) ["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"] |> List.map (fun s -> async { return System.String.Format( "{0} {1}", s, ((regex s).Matches text).Count) } ) |> Async.Parallel |> Async.RunSynchronously |> Array.iter (printfn "%s") let newTextLength t = ["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)"] |> List.fold (fun s (code, alt) -> (regex code).Replace (s, alt)) t |> String.length let newText = text |> onblocks [] |> Seq.map (fun s -> async { return newTextLength s } ) |> Async.Parallel |> Async.RunSynchronously |> Array.sum printf "\n%i\n%i\n%i\n" input.Length text.Length newText
Wed, 13 Feb 2013 03:01:43 GMT MAKE: mv regexdna.fsharp regexdna.fs /usr/local/bin/fsharpc --target:exe --platform:x86 -O -o regexdna.fsharp_run.exe regexdna.fs Microsoft (R) F# 3.0 Compiler version (Mono build) Copyright (c) Microsoft Corporation. All Rights Reserved. rm regexdna.fs 3.86s to complete and log all make actions COMMAND LINE: /usr/local/bin/mono --llvm --gc=sgen regexdna.fsharp_run.exe 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 <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!