/mobile Handheld Friendly website

 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.480.4815,812267  0% 0% 0% 100%
5,000,0000.620.6316,604267  3% 0% 2% 100%
50,000,0002.122.1315,552267  1% 0% 0% 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

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)

 thread-ring F# Mono #4 program source code

(*  The Computer Language Benchmarks Game

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



    contributed by Jomo Fisher

    modified by Kostas Rontogiannis



    Using an array of Async<unit> for the workers and

    a shared token between threads.



    Compile : 

        fsc --tailcalls+ -O --platform:x64 ThreadRingNew.fs -o ThreadRingNew.exe

    Execute :

        mono ThreadRingNew.exe 50000000

*)

let NumberOfThreads = 503

let mutable (workers : Async<unit>[]) = null
let mutable token = -1

let createWorker i = 
    let next = (i + 1) % NumberOfThreads
    async { if token = 0 then 
                printfn "%d" (i + 1)
                exit 0 
            else 
                token <- token - 1
                return! workers.[next] }

[<EntryPoint>]
let main args = 
    token   <- int args.[0]
    workers <- Array.init NumberOfThreads createWorker
    Async.StartImmediate(workers.[0])
    0

 make, command-line, and program output logs

Wed, 13 Feb 2013 03:41:39 GMT

MAKE:
mv threadring.fsharp-4.fsharp threadring.fsharp-4.fs
/usr/local/bin/fsharpc --target:exe --platform:x86 -O  -o threadring.fsharp-4.fsharp_run.exe threadring.fsharp-4.fs
Microsoft (R) F# 3.0 Compiler version (Mono build)
Copyright (c) Microsoft Corporation. All Rights Reserved.

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

COMMAND LINE:
/usr/local/bin/mono --llvm threadring.fsharp-4.fsharp_run.exe 50000000

PROGRAM OUTPUT:
292

<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!

Revised BSD license

  Home   Conclusions   License   Play