/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® quad-core |
Each table row shows performance measurements for this Dart program with a particular command-line input value N.
| N | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| 10 | 0.46 | 0.48 | 6,260 | 538 | 0% 90% 8% 2% |
| 11 | 5.64 | 5.64 | 6,260 | 538 | 0% 1% 0% 100% |
| 12 | 78.75 | 78.77 | 6,264 | 538 | 29% 0% 0% 71% |
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.
Dart VM version: 0.4.7.1_r21537 (Tue Apr 16 01:34:29 2013)
"The Dart team has provided an official benchmark harness that ensures your benchmark follows the benchmarking procedures necessary for the Dart VM’s optimizer."
Here are the measurements reported from benchmark_harness.dart with n=10 n=11 n=12 on x64q
Template(RunTime): 4943000.0. Template(RunTime): 63839000.0 us. Template(RunTime): 889724000.0 us.
Which is actually --
0.49 secs 6.38 secs 88.97 secs
/* The Computer Language Benchmarks Game http://benchmarksgame.alioth.debian.org/ warmup code suggested by Vyacheslav Egorov contributed by Jos Hirth transliterated from Isaac Gouy's C# program, which was transliterated from Mike Pall's Lua program */ import 'dart:io'; fannkuch(n) { var p = new List<int>(n), q = new List<int>(n), s = new List<int>(n); int sign = 1, maxflips = 0, sum = 0, m = n-1; for(int i=0; i<n; i++){ p[i] = i; q[i] = i; s[i] = i; } do { // Copy and flip. var q0 = p[0]; // Cache 0th element. if (q0 != 0){ for(int i=1; i<n; i++) q[i] = p[i]; // Work on a copy. var flips = 1; do { var qq = q[q0]; if (qq == 0){ // ... until 0th element is 0. sum += sign*flips; if (flips > maxflips) maxflips = flips; // New maximum? break; } q[q0] = q0; if (q0 >= 3){ int i = 1, j = q0 - 1, t; do { t = q[i]; q[i] = q[j]; q[j] = t; i++; j--; } while (i < j); } q0 = qq; flips++; } while (true); } // Permute. if (sign == 1){ var t = p[1]; p[1] = p[0]; p[0] = t; sign = -1; // Rotate 0<-1. } else { var t = p[1]; p[1] = p[2]; p[2] = t; sign = 1; // Rotate 0<-1 and 0<-1<-2. for(int i=2; i<n; i++){ var sx = s[i]; if (sx != 0){ s[i] = sx-1; break; } if (i == m) return [sum,maxflips]; // Out of permutations. s[i] = i; // Rotate 0<-...<-i+1. t = p[0]; for(int j=0; j<=i; j++){ p[j] = p[j+1]; } p[i+1] = t; } } } while (true); } void main() { // No OSR so... warmup code fannkuch(5); var n = (){ var args = new Options().arguments; return args.length > 0 ? int.parse(args[0]) : 7; }(); var pf = fannkuch(n); print("${pf[0]}\nPfannkuchen($n) = ${pf[1]}"); }
Thu, 18 Apr 2013 02:57:40 GMT COMMAND LINE: /usr/local/src/dart-sdk/bin/dart fannkuchredux.dart-2.dart 12 PROGRAM OUTPUT: 3968050 Pfannkuchen(12) = 65