Index: third_party/pkg/angular/perf/loop_perf.dart |
diff --git a/third_party/pkg/angular/perf/loop_perf.dart b/third_party/pkg/angular/perf/loop_perf.dart |
deleted file mode 100644 |
index 819daf45583af725cc4f9c28cec24096d549c4f3..0000000000000000000000000000000000000000 |
--- a/third_party/pkg/angular/perf/loop_perf.dart |
+++ /dev/null |
@@ -1,71 +0,0 @@ |
-library loop_perf; |
- |
-import 'package:benchmark_harness/benchmark_harness.dart'; |
- |
-class IterationBenchmark extends BenchmarkBase { |
- List<int> list = new List.generate(1000, (i) => i); |
- Map map; |
- var r = 0; |
- IterationBenchmark(name) : super(name) { |
- map = new Map.fromIterable(list, key: (i) => i, value: (i) => i); |
- } |
-} |
- |
-class ForEach extends IterationBenchmark { |
- ForEach() : super('forEach'); |
- run() { |
- var count = 0; |
- list.forEach((int i) => count = count + i); |
- return count; |
- } |
-} |
- |
-class ForEachMap extends IterationBenchmark { |
- ForEachMap() : super('forEachMap'); |
- run() { |
- var count = 0; |
- map.forEach((int k, int v) => count = count + k + v); |
- return count; |
- } |
-} |
- |
-class ForIn extends IterationBenchmark { |
- ForIn() : super('for in'); |
- run() { |
- var count = 0; |
- for(int item in list) { |
- count = count + item; |
- } |
- return count; |
- } |
-} |
- |
-class ForInMap extends IterationBenchmark { |
- ForInMap() : super('for in Map'); |
- run() { |
- var count = 0; |
- for(int key in map.keys) { |
- count = count + key + map[key]; |
- } |
- return count; |
- } |
-} |
- |
-class ForLoop extends IterationBenchmark { |
- ForLoop() : super('for loop'); |
- run() { |
- int count = 0; |
- for(int i = 0; i < list.length; i++) { |
- count += list[i]; |
- } |
- return count; |
- } |
-} |
- |
-void main() { |
- new ForEach().report(); |
- new ForIn().report(); |
- new ForLoop().report(); |
- new ForEachMap().report(); |
- new ForInMap().report(); |
-} |