Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: lib/compiler/implementation/scanner/scanner_bench.dart

Issue 10091048: Fix remaining warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, 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 /**
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 ++ticks; 105 ++ticks;
106 } 106 }
107 107
108 void end() { 108 void end() {
109 if (total > 10) { 109 if (total > 10) {
110 print("$up$clear[$hashes] 100% ${score()}"); 110 print("$up$clear[$hashes] 100% ${score()}");
111 } 111 }
112 } 112 }
113 113
114 void recordScore(num score) { 114 void recordScore(num newScore) {
115 scores.addLast(score); 115 scores.addLast(newScore);
116 } 116 }
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();
(...skipping 15 matching lines...) Expand all
141 141
142 void end() { 142 void end() {
143 } 143 }
144 144
145 void recordScore(num score) { 145 void recordScore(num score) {
146 if (total > 10) { 146 if (total > 10) {
147 print("$ticks, $score, ${ticks * 100 ~/ total}%"); 147 print("$ticks, $score, ${ticks * 100 ~/ total}%");
148 } 148 }
149 } 149 }
150 } 150 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698