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

Unified Diff: third_party/pkg/angular/perf/loop_perf.dart

Issue 180843004: Revert revision 33053 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/pkg/angular/perf/dom/compile_perf.dart ('k') | third_party/pkg/angular/perf/mirror_perf.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/perf/loop_perf.dart
===================================================================
--- third_party/pkg/angular/perf/loop_perf.dart (revision 33054)
+++ third_party/pkg/angular/perf/loop_perf.dart (working copy)
@@ -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();
-}
« no previous file with comments | « third_party/pkg/angular/perf/dom/compile_perf.dart ('k') | third_party/pkg/angular/perf/mirror_perf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698