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

Side by Side Diff: third_party/pkg/di/benchmark/injector_benchmark_common.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
OLDNEW
1 library di.injector_benchmark_common; 1 library di.injector_benchmark_common;
2 2
3 import 'package:benchmark_harness/benchmark_harness.dart'; 3 import 'package:benchmark_harness/benchmark_harness.dart';
4 import 'package:di/di.dart'; 4 import 'package:di/di.dart';
5 5
6 int count = 0; 6 int count = 0;
7 7
8 class InjectorBenchmark extends BenchmarkBase { 8 class InjectorBenchmark extends BenchmarkBase {
9 var injectorFactory; 9 var injectorFactory;
10 var module; 10 var module;
11 11
12 InjectorBenchmark(name, this.injectorFactory) : super(name); 12 InjectorBenchmark(name, this.injectorFactory) : super(name);
13 13
14 void run() { 14 void run() {
15 Injector injector = injectorFactory([module]); 15 Injector injector = injectorFactory([module]);
16 injector.get(A); 16 injector.get(A);
17 injector.get(B); 17 injector.get(B);
18 18
19 var childInjector = injector.createChild([module]); 19 var childInjector = injector.createChild([module]);
20 childInjector.get(A); 20 childInjector.get(A);
21 childInjector.get(B); 21 childInjector.get(B);
22 } 22 }
23 23
24 setup() { 24 setup() {
25 module = new Module() 25 module = new Module()
26 ..type(A) 26 ..type(A)
27 ..type(B) 27 ..type(B)
28 ..type(C) 28 ..type(C)
29 ..type(C, withAnnotation: AnnOne, implementedBy: COne )
30 ..type(D) 29 ..type(D)
31 ..type(E) 30 ..type(E);
32 ..type(E, withAnnotation: AnnTwo, implementedBy: ETwo )
33 ..type(F)
34 ..type(G);
35 } 31 }
36 32
37 teardown() { 33 teardown() {
38 print(count); 34 print(count);
39 } 35 }
40 } 36 }
41 37
42 class AnnOne {
43 const AnnOne();
44 }
45
46 class AnnTwo {
47 const AnnTwo();
48 }
49
50 class A { 38 class A {
51 A(B b, C c) { 39 A(B b, C c) {
52 count++; 40 count++;
53 } 41 }
54 } 42 }
55 43
56 class B { 44 class B {
57 B(D b, E c) { 45 B(D b, E c) {
58 count++; 46 count++;
59 } 47 }
60 } 48 }
61 49
62 class C { 50 class C {
63 C() { 51 C() {
64 count++; 52 count++;
65 } 53 }
66 } 54 }
67 55
68 class COne {
69 COne() {
70 count++;
71 }
72 }
73
74 class D { 56 class D {
75 D() { 57 D() {
76 count++; 58 count++;
77 } 59 }
78 } 60 }
79 61
80 class E { 62 class E {
81 E() { 63 E() {
82 count++; 64 count++;
83 } 65 }
84 } 66 }
85
86 class ETwo {
87 ETwo() {
88 count++;
89 }
90 }
91
92 class F {
93 F(@AnnOne() C c, D d) {
94 count++;
95 }
96 }
97
98 class G {
99 G(@AnnTwo() E) {
100 count++;
101 }
102 }
OLDNEW
« no previous file with comments | « third_party/pkg/di/REVISION ('k') | third_party/pkg/di/benchmark/static_injector_benchmark.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698