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
10Failed  551   

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

Read fannkuch-redux benchmark to see what this program should do.

 notes

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

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

 fannkuch-redux F# Mono program source code

(* The Computer Language Benchmarks Game
   http://benchmarksgame.alioth.debian.org/

   from Scala version by Otto Bommer, August 2010
*)

let fannkuch n =
  begin
  let perm1 = Array.create n 0 in for i = 0 to (n-1) do perm1.[i] <- i done;
  let perm = Array.create n 0
  let count = Array.create n 0
  let mutable flips = 0 
  let mutable maxflips = 0 
  let mutable checksum = 0 
  let mutable nperm = 0
  let mutable r = n
  while r > 0 do 
    for i = 0 to n-1 do perm.[i] <- perm1.[i] done;

    while r <> 1 do count.[r-1] <- r; r <- r - 1; done;

    flips <- 0;
    let k = ref perm.[0] in
    while !k <> 0 do
      let t = ref 0 in
      for i = 0 to !k / 2 do
        t := perm.[i];
        perm.[i] <- perm.[!k - i];
        perm.[!k - i] <- !t;
        done;
        
      k := perm.[0];
      flips <- flips + 1;
      done;

    maxflips <- max maxflips flips;
    if nperm &&& 1 = 0 then checksum <- checksum + flips else checksum <- checksum - flips
    
    let mutable go = true in
    let mutable t = 0 in
    while go do
      if r = n then begin go <- false; r <- 0; end
      else
        begin
        t <- perm1.[0];
        for i = 0 to r - 1 do perm1.[i] <- perm1.[i+1] done;
        perm1.[r] <- t;

        count.[r] <- count.[r] - 1;
        if count.[r] > 0 then go <- false
        else r <- r + 1;
        end
      done;

    nperm <- nperm + 1;
    done;

  (maxflips, checksum);
  end

let _ =
  let n = try int((System.Environment.GetCommandLineArgs()).[1]) with _ -> 7
  let (maxflips, checksum) = fannkuch n
  Printf.printf "%d\nPfannkuchen(%d) = %d\n" checksum n maxflips

 make, command-line, and program output logs

Wed, 27 May 2015 03:48:49 GMT

MAKE:
mv fannkuchredux.fsharp fannkuchredux.fs
/usr/local/bin/fsharpc --target:exe --platform:x64 -O  -o fannkuchredux.fsharp_run.exe fannkuchredux.fs
F# Compiler for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
rm fannkuchredux.fs
3.94s to complete and log all make actions

COMMAND LINE:
/usr/local/bin/mono --llvm --gc=sgen fannkuchredux.fsharp_run.exe 10

PROGRAM FAILED 


PROGRAM OUTPUT:

mono: /usr/local/src/llvm/include/llvm/IR/Instructions.h:999: void llvm::ICmpInst::AssertOK(): Assertion `getOperand(0)->getType() == getOperand(1)->getType() && "Both operands to ICmp instruction are not of the same type!"' failed.
Stacktrace:

  at <unknown> <0xffffffff>
  at Microsoft.FSharp.Core.PrintfModule.PrintFormatToTextWriter<T_REF> (System.IO.TextWriter,Microsoft.FSharp.Core.PrintfFormat`4<T_REF, System.IO.TextWriter, Microsoft.FSharp.Core.Unit, Microsoft.FSharp.Core.Unit>) <0x00047>
  at <StartupCode$fannkuchredux-fsharp_run>.$Fannkuchredux.main@ () <0x000f7>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	/usr/local/bin/mono() [0x61d0e0]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f27d831bd10]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f27d7d60267]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f27d7d61eca]
	/lib/x86_64-linux-gnu/libc.so.6(+0x2e03d) [0x7f27d7d5903d]
	/lib/x86_64-linux-gnu/libc.so.6(+0x2e0f2) [0x7f27d7d590f2]
	/usr/local/bin/mono() [0x7da6c6]
	/usr/local/bin/mono(LLVMBuildICmp+0x47) [0x112b6c7]
	/usr/local/bin/mono() [0x658617]
	/usr/local/bin/mono() [0x6922b9]
	/usr/local/bin/mono() [0x6930b7]
	/usr/local/bin/mono() [0x59ee7c]
	/usr/local/bin/mono() [0x59f4bb]
	/usr/local/bin/mono() [0x61e370]
	[0x41ee3166]

Debug info from gdb:


=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Revised BSD license

  Home   Conclusions   License   Play