/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one 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 |
|---|---|---|---|---|---|
| 1,000 | 0.37 | 0.41 | 252 | 800 | 0% 0% 3% 100% |
| 4,000 | 3.17 | 3.17 | 17,308 | 800 | 0% 1% 1% 100% |
| 16,000 | 47.56 | 47.57 | 48,464 | 800 | 0% 0% 0% 100% |
Read the ↓ make, command line, and program output logs to see how this program was run.
Read mandelbrot 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/ Adapted by Antti Lankila from the earlier Isaac Gouy's implementation Add multithread & tweaks from C++ by The Anh Tran Translate to F# by Jomo Fisher *) open System open System.Threading open System.IO let mutable N = 200; let mutable width_bytes = 0 let mutable data : byte array array = null let mutable nbyte_each_line : int array = null let current_line = ref -1 let Calculate() = let inverse_n = 2.0 / float N let mutable y = Interlocked.Increment(¤t_line.contents) while y < N do // fetch a line let pdata = data.[y] let mutable byte_count = 0 let mutable bit_num = 0 let mutable byte_acc = 0 let Civ = float y * inverse_n - 1.0 for x in 0..N-1 do let Crv = float x * inverse_n - 1.5 let mutable Zrv = Crv let mutable Ziv = Civ let mutable Trv = Crv * Crv let mutable Tiv = Civ * Civ let mutable i = 49; let mutable more = true while more do Ziv <- (Zrv * Ziv) + (Zrv * Ziv) + Civ Zrv <- Trv - Tiv + Crv Trv <- Zrv * Zrv Tiv <- Ziv * Ziv more <- (Trv + Tiv) <= 4.0 if more then i <- i - 1 more <- i > 0 byte_acc <- byte_acc <<< 1 byte_acc <- byte_acc ||| (if i = 0 then 1 else 0) bit_num <- bit_num + 1 if bit_num = 8 then pdata.[byte_count] <- byte byte_acc byte_count <- byte_count + 1 bit_num <- 0 byte_acc <- 0 if bit_num <> 0 then // write left over bits byte_acc <- byte_acc <<< (8 - (N &&& 7)) pdata.[byte_count] <- byte byte_acc byte_count<-byte_count + 1 nbyte_each_line.[y] <- byte_count y <- Interlocked.Increment(¤t_line.contents) [<EntryPoint>] let main args = if args.Length > 0 then N <- int args.[0] Console.Out.WriteLine("P4\n{0} {0}", N); width_bytes <- N / 8 if width_bytes * 8 < N then width_bytes <- width_bytes + 1 nbyte_each_line <- Array.zeroCreate N data <- Array.zeroCreate N for i in 0..N-1 do data.[i] <- Array.zeroCreate width_bytes let threads = Array.init (Environment.ProcessorCount-1) (fun i->new Thread(Calculate)) for thread in threads do thread.Start() Calculate() for thread in threads do thread.Join() let s = Console.OpenStandardOutput(); for y in 0..N-1 do s.Write(data.[y], 0, nbyte_each_line.[y]) 0
Wed, 13 Feb 2013 01:42:55 GMT MAKE: mv mandelbrot.fsharp-3.fsharp mandelbrot.fsharp-3.fs /usr/local/bin/fsharpc --target:exe --platform:x86 -O -o mandelbrot.fsharp-3.fsharp_run.exe mandelbrot.fsharp-3.fs Microsoft (R) F# 3.0 Compiler version (Mono build) Copyright (c) Microsoft Corporation. All Rights Reserved. /home/dunham/benchmarksgame_onecore/mandelbrot/tmp/mandelbrot.fsharp-3.fs(9,1): warning FS0221: The declarations in this file will be placed in an implicit module 'Mandelbrot.fsharp-3' based on the file name 'mandelbrot.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 mandelbrot.fsharp-3.fs 3.90s to complete and log all make actions COMMAND LINE: /usr/local/bin/mono --llvm mandelbrot.fsharp-3.fsharp_run.exe 16000 (BINARY) PROGRAM OUTPUT NOT SHOWN <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!