/mobile Handheld Friendly website
x64 Ubuntu : Intel® Q6600® one core |
Each table row shows performance measurements for this OCaml program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 1,000 | 0.22 | 0.23 | 748 | 444 | 0% 0% 5% 96% |
| 4,000 | 3.51 | 3.52 | 3,108 | 444 | 0% 0% 0% 100% |
| 16,000 | 55.70 | 55.72 | 3,112 | 444 | 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.
The OCaml native-code compiler, version 4.00.1
(* * The Computer Language Benchmarks Game * http://benchmarksgame.alioth.debian.org/ * * Contributed by Paolo Ribeca * * (Very loosely based on previous version Ocaml #3, * which had been contributed by * Christophe TROESTLER * and enhanced by * Christian Szegedy and Yaron Minsky) *) let niter = 50 let limit = 4. let () = let w = int_of_string (Array.get Sys.argv 1) in let h = w in let fw = float w /. 2. and fh = float h /. 2. in Printf.printf "P4\n%i %i\n" w h; let red_h = h - 1 and red_w = w - 1 and byte = ref 0 in for y = 0 to red_h do let ci = float y /. fh -. 1. in for x = 0 to red_w do let cr = float x /. fw -. 1.5 and zr = ref 0. and zi = ref 0. and trmti = ref 0. and n = ref 0 in begin try while true do zi := 2. *. !zr *. !zi +. ci; zr := !trmti +. cr; let tr = !zr *. !zr and ti = !zi *. !zi in if tr +. ti > limit then begin byte := !byte lsl 1; raise Exit end else if incr n; !n = niter then begin byte := (!byte lsl 1) lor 0x01; raise Exit end else trmti := tr -. ti done with Exit -> () end; if x mod 8 = 7 then output_byte stdout !byte done; let rem = w mod 8 in if rem != 0 then (* the row doesnt divide evenly by 8 *) output_byte stdout (!byte lsl (8 - rem)) (* output last few bits *) done
Sat, 02 Feb 2013 22:48:37 GMT MAKE: mv mandelbrot.ocaml-6.ocaml mandelbrot.ocaml-6.ml /usr/local/bin/ocamlopt -noassert -unsafe -fno-PIC -nodynlink -inline 100 unix.cmxa mandelbrot.ocaml-6.ml -o mandelbrot.ocaml-6.ocaml_run File "mandelbrot.ocaml-6.ml", line 1: Warning 24: bad source file name: "Mandelbrot.ocaml-6" is not a valid module name. rm mandelbrot.ocaml-6.ml 0.20s to complete and log all make actions COMMAND LINE: ./mandelbrot.ocaml-6.ocaml_run 16000 (BINARY) PROGRAM OUTPUT NOT SHOWN