OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 // |
| 5 // NOTE: See also wrapper script sdk/runtime/tools/bmu_benchmark_gallery.sh |
| 6 // |
5 // Tool to compute bounded mutator utilization (BMU) from a --verbose_gc log. | 7 // Tool to compute bounded mutator utilization (BMU) from a --verbose_gc log. |
6 // Outputs CSV suitable for, e.g., gnuplot: | 8 // Outputs CSV suitable for, e.g., gnuplot: |
7 // | 9 // |
8 // dart --verbose_gc foo.dart 2> foo.gclog | 10 // dart --verbose_gc foo.dart 2> foo.gclog |
9 // dart verbose_gc_to_bmu.dart < foo.gclog > foo.bmu | 11 // dart verbose_gc_to_bmu.dart < foo.gclog > foo.bmu |
10 // gnuplot -p -e "set yr [0:1]; set logscale x; plot 'foo.bmu' with linespoints" | 12 // gnuplot -p -e "set yr [0:1]; set logscale x; plot 'foo.bmu' with linespoints" |
11 | 13 |
12 import 'dart:io'; | 14 import 'dart:io'; |
13 import 'dart:math'; | 15 import 'dart:math'; |
14 | 16 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 98 } |
97 print('# window_size_ms, bounded_mutator_utilization'); | 99 print('# window_size_ms, bounded_mutator_utilization'); |
98 var minimumSeen = 1.0; | 100 var minimumSeen = 1.0; |
99 for (int w = t._run.length; | 101 for (int w = t._run.length; |
100 w > 1000 * MINIMUM_WINDOW_SIZE_MS; | 102 w > 1000 * MINIMUM_WINDOW_SIZE_MS; |
101 w = (w * WINDOW_STEP_FACTOR).floor()) { | 103 w = (w * WINDOW_STEP_FACTOR).floor()) { |
102 minimumSeen = min(minimumSeen, t.minUtilization(w)); | 104 minimumSeen = min(minimumSeen, t.minUtilization(w)); |
103 print('${w / 1000}, $minimumSeen'); | 105 print('${w / 1000}, $minimumSeen'); |
104 } | 106 } |
105 } | 107 } |
OLD | NEW |