| OLD | NEW |
| 1 library scope_perf; | 1 library scope_perf; |
| 2 | 2 |
| 3 import '_perf.dart'; | 3 import '_perf.dart'; |
| 4 import 'package:angular/core/module.dart'; | 4 import 'package:angular/core/module.dart'; |
| 5 import 'package:angular/core/parser/parser_library.dart'; | 5 import 'package:angular/core/parser/parser.dart'; |
| 6 import 'package:di/di.dart'; | 6 import 'package:di/di.dart'; |
| 7 import 'package:di/dynamic_injector.dart'; | 7 import 'package:di/dynamic_injector.dart'; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 var scope = new DynamicInjector( | 10 var scope = new DynamicInjector( |
| 11 modules: [new Module() | 11 modules: [new Module() |
| 12 ..type(Parser, implementedBy: DynamicParser)], | 12 ..type(Parser, implementedBy: DynamicParser) |
| 13 ..type(ParserBackend, implementedBy: DynamicParserBackend)], |
| 13 allowImplicitInjection:true).get(Scope); | 14 allowImplicitInjection:true).get(Scope); |
| 14 var scope2, scope3, scope4, scope5; | 15 var scope2, scope3, scope4, scope5; |
| 15 var fill = (scope) { | 16 var fill = (scope) { |
| 16 for(var i = 0; i < 10000; i++) { | 17 for(var i = 0; i < 10000; i++) { |
| 17 scope['key_$i'] = i; | 18 scope['key_$i'] = i; |
| 18 } | 19 } |
| 19 return scope; | 20 return scope; |
| 20 }; | 21 }; |
| 21 | 22 |
| 22 scope = fill(scope); | 23 scope = fill(scope); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 time('scope[] 3 deep', () => scope3['nenexistant']); | 58 time('scope[] 3 deep', () => scope3['nenexistant']); |
| 58 time('scope[] 4 deep', () => scope4['nenexistant']); | 59 time('scope[] 4 deep', () => scope4['nenexistant']); |
| 59 time('scope[] 5 deep', () => scope5['nenexistant']); | 60 time('scope[] 5 deep', () => scope5['nenexistant']); |
| 60 } | 61 } |
| 61 | 62 |
| 62 class A { | 63 class A { |
| 63 var number = 1; | 64 var number = 1; |
| 64 var str = 'abc'; | 65 var str = 'abc'; |
| 65 var obj = {}; | 66 var obj = {}; |
| 66 } | 67 } |
| OLD | NEW |