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
500,0000.740.7423,104329  0% 0% 3% 100%
5,000,0002.412.4223,252329  1% 2% 0% 100%
50,000,00019.7019.7232,392329  0% 1% 1% 100%

Read the ↓ make, command line, and program output logs to see how this program was run.

Read thread-ring benchmark to see what this program should do.

 notes

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

Mono JIT compiler version 3.10.1 (master/9fd3c7a Thu Sep 11 15:32:17 PDT 2014)
LLVM: yes(3.4svn-mono-mono/e656cac)
GC: sgen

 thread-ring F# Mono #3 program source code

(*  The Computer Language Benchmarks Game

    http://benchmarksgame.alioth.debian.org/



    Contributed by Jomo Fisher



    Uses F# asyncs. Asyncs are triggered by tailcall in sequence as progress is 

    made around the ring. 

*)
let ringLength = 503

let cells = Array.zeroCreate ringLength
let threads = Array.zeroCreate ringLength
let answer = ref -1

let createWorker i = 
    let next = (i+1)%ringLength
    async { let value = cells.[i]
            if false then () 
            match value with
            | 0 -> answer := i+1
            | _ -> 
                cells.[next] <- value - 1 
                return! threads.[next] }
    
[<EntryPoint>]
let main args = 
    cells.[0] <- if args.Length>0 then int args.[0] else 50000000
    for i in 0..ringLength-1 do 
        threads.[i]<-createWorker i

    let result = Async.StartImmediate(threads.[0])
    printfn "%d" !answer
    0


 make, command-line, and program output logs

Fri, 12 Sep 2014 16:07:39 GMT

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

/home/dunham/benchmarksgame_onecore/threadring/tmp/threadring.fsharp-3.fs(9,1): warning FS0221: The declarations in this file will be placed in an implicit module 'Threadring.fsharp-3' based on the file name 'threadring.fsharp-3.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 threadring.fsharp-3.fs
3.75s to complete and log all make actions

COMMAND LINE:
/usr/local/bin/mono --llvm --gc=sgen threadring.fsharp-3.fsharp_run.exe 50000000

PROGRAM OUTPUT:
292

Revised BSD license

  Home   Conclusions   License   Play