/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one core |
Each table row shows performance measurements for this C# Mono program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 1,000 | 0.30 | 0.31 | 252 | 701 | 3% 3% 0% 100% |
| 4,000 | 2.95 | 2.95 | 16,784 | 701 | 1% 0% 0% 100% |
| 16,000 | 45.25 | 45.26 | 47,676 | 701 | 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.
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 Simplified bit logic and cleaned code by Robert F. Tobler */ using System; using System.Threading; using System.IO; public class MandelBrot { private static int n = 200; private static byte[][] data; private static int lineCount = -1; private static double[] xa; public static void Main (String[] args) { if (args.Length > 0) n = Int32.Parse(args[0]); Console.Out.WriteLine("P4\n{0} {0}", n); int lineLen = (n-1)/8 + 1; data = new byte[n][]; for (int i = 0; i < n; i++) data[i] = new byte[lineLen]; xa = new double[n]; for (int x = 0; x < n; x++) xa[x] = x * 2.0/n - 1.5; var threads = new Thread[Environment.ProcessorCount]; for (int i = 0; i < threads.Length; i++) (threads[i] = new Thread(MandelBrot.Calculate)).Start(); foreach (var t in threads) t.Join(); var s = Console.OpenStandardOutput(); for (int y = 0; y < n; y++) s.Write(data[y], 0, lineLen); } private static void Calculate() { int y; while ((y = Interlocked.Increment(ref lineCount)) < n) { var line = data[y]; int xbyte = 0, bits = 1; double ci = y * 2.0/n - 1.0; for (int x = 0; x < n; x++) { double cr = xa[x]; if (bits > 0xff) { line[xbyte++] = (byte)bits; bits = 1; } double zr = cr, zi = ci, tr = cr * cr, ti = ci * ci; int i = 49; do { zi = zr * zi + zr * zi + ci; zr = tr - ti + cr; tr = zr * zr; ti = zi * zi; } while ((tr + ti <= 4.0) && (--i > 0)); bits = (bits << 1) | (i == 0 ? 1 : 0); } while (bits < 0x100) bits = (bits << 1); line[xbyte] = (byte)bits; } } }
Tue, 12 Feb 2013 20:38:32 GMT MAKE: mv mandelbrot.csharp-3.csharp mandelbrot.csharp-3.cs /usr/local/bin/mcs -optimize+ -platform:x86 -out:mandelbrot.csharp-3.csharp_run mandelbrot.csharp-3.cs rm mandelbrot.csharp-3.cs 0.24s to complete and log all make actions COMMAND LINE: /usr/local/bin/mono --llvm mandelbrot.csharp-3.csharp_run 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!