| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #library('scanner_bench'); | 5 #library('scanner_bench'); |
| 6 #import('scannerlib.dart'); | 6 #import('scannerlib.dart'); |
| 7 #import('scanner_implementation.dart'); | 7 #import('scanner_implementation.dart'); |
| 8 #source('source_list.dart'); | 8 #source('source_list.dart'); |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * A common superclass for scanner benchmarks. | 11 * A common superclass for scanner benchmarks. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 int score() { | 118 int score() { |
| 119 num geoMean = 1; | 119 num geoMean = 1; |
| 120 int count = Math.min(scores.length, GEOMEAN_COUNT); | 120 int count = Math.min(scores.length, GEOMEAN_COUNT); |
| 121 for (int i = scores.length - count; i < scores.length; i++) { | 121 for (int i = scores.length - count; i < scores.length; i++) { |
| 122 geoMean *= scores[i]; | 122 geoMean *= scores[i]; |
| 123 } | 123 } |
| 124 geoMean = Math.pow(geoMean, 1/Math.max(count, 1)); | 124 geoMean = Math.pow(geoMean, 1/Math.max(count, 1)); |
| 125 return geoMean.round().toInt(); | 125 return geoMean.round().toInt(); |
| 126 } | 126 } |
| 127 } | 127 } |
| OLD | NEW |