Index: utils/tests/string_encoding/benchmark_runner.dart |
diff --git a/utils/tests/string_encoding/benchmark_runner.dart b/utils/tests/string_encoding/benchmark_runner.dart |
index f92c59389eb2ede09f90ace2dd3b96dcfc6297a0..48c0b4a4523904778f6e48ac8ccbd4b61742db51 100644 |
--- a/utils/tests/string_encoding/benchmark_runner.dart |
+++ b/utils/tests/string_encoding/benchmark_runner.dart |
@@ -58,11 +58,11 @@ class PerformanceModel { |
overheadNanos = |
((((sumY * sumXSquared) - (sumX * sumXY)) / |
- ((n * sumXSquared) - (sumX * sumX))) / source.length).toInt(); |
+ ((n * sumXSquared) - (sumX * sumX))) / source.length).truncate(); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
Indent by one more here.
|
perRequestNanos = |
(((n * sumXY) - (sumX * sumY)) / |
- ((n * sumXSquared) - (sumX * sumX))).toInt(); |
+ ((n * sumXSquared) - (sumX * sumX))).truncate(); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
Ditto.
|
} |
} |
@@ -72,14 +72,14 @@ class PerformanceModel { |
int perRequestNanos; |
int repsFor(int targetDurationNanos, [int blocksize = -1]) { |
if (blocksize <= 0) { |
- return ((targetDurationNanos - overheadNanos) / perRequestNanos).toInt(); |
+ return ((targetDurationNanos - overheadNanos) / perRequestNanos).truncate(); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
Long line. Use ~/ ?
|
} else { |
int blockTime = overheadNanos + (blocksize * perRequestNanos); |
int fullBlocks = targetDurationNanos ~/ blockTime; |
int extraReps = |
((targetDurationNanos - (fullBlocks * blockTime)) - overheadNanos) |
~/ perRequestNanos; |
- return ((fullBlocks * blocksize) + extraReps).toInt(); |
+ return ((fullBlocks * blocksize) + extraReps).truncate(); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
All operands are int, so drop truncate.
|
} |
} |
} |
@@ -104,8 +104,8 @@ class TestReport { |
} |
int resultsMeanNanos() => |
- (BlockSample._totalTime(results) / |
- BlockSample._totalCount(results)).toInt(); |
+ (BlockSample._totalTime(results) ~/ |
+ BlockSample._totalCount(results)); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
Indent by 1 more, or put on same line if possible.
floitsch
2013/03/11 13:39:15
Done in a different CL.
|
int resultsWorstNanos() { |
BlockSample worst = worstBlock(results); |
@@ -185,7 +185,7 @@ class TestReport { |
if (val.isInfinite || val.isNaN) { |
return "NaN"; |
} else { |
- return val.toInt().toString(); |
+ return val.truncate().toString(); |
Lasse Reichstein Nielsen
2013/01/04 10:29:42
.toStringAsFixed(0)
|
} |
} |