performance measurements

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,0003.613.6159,832413  0% 2% 1% 100%
500,00011.6111.62111,896413  0% 1% 1% 100%
5,000,00091.4091.44754,460413  0% 1% 1% 100%

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.


F# Compiler for F# 3.1 (Open Source Edition)

Mono JIT compiler version 4.1.0 (master/435cc01 Wed May 20 21:03:41 PDT 2015)
LLVM: yes(3.6.0svn-mono-master/ce4fcec)
GC: sgen

 regex-dna F# Mono #2 program source code

// The Computer Language Benchmarks Game
// Contributed by Valentin Kraevskiy

open System.Text.RegularExpressions

let regex s = Regex (s, RegexOptions.Compiled)
let input = stdin.ReadToEnd ()
let text = (regex ">.*\n|\n").Replace (input, "")

|> List.iter (fun s ->
         printf "%s %i\n" s ((regex s).Matches text).Count)

let newText =
    ["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)) text

printf "\n%i\n%i\n%i\n" input.Length text.Length newText.Length

 make, command-line, and program output logs

Thu, 21 May 2015 18:05:38 GMT

mv regexdna.fsharp-2.fsharp regexdna.fsharp-2.fs
/usr/local/bin/fsharpc --target:exe --platform:x86 -O  -o regexdna.fsharp-2.fsharp_run.exe regexdna.fsharp-2.fs
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License

/home/dunham/benchmarksgame_onecore/regexdna/tmp/regexdna.fsharp-2.fs(6,1): warning FS0221: The declarations in this file will be placed in an implicit module 'Regexdna.fsharp-2' based on the file name 'regexdna.fsharp-2.fs'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file.
rm regexdna.fsharp-2.fs
3.97s to complete and log all make actions

/usr/local/bin/mono --llvm --gc=sgen regexdna.fsharp-2.fsharp_run.exe 0 < regexdna-input5000000.txt

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


Revised BSD license

  Home   Conclusions   License   Play