-
Notifications
You must be signed in to change notification settings - Fork 248
[WIP] perf(View): Improve View instantiation speed and memory consumption. #1178
Conversation
@@ -36,8 +36,10 @@ packages: | |||
source: hosted | |||
version: "0.9.2" | |||
di: | |||
description: di | |||
source: hosted | |||
description: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to merge this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we don't not final, work in progress. :-)
=> injector.name == SHADOW_DOM_INJECTOR_NAME ? injector.parent : injector; | ||
abstract class DirectiveBinder { | ||
bind(key, {Function toFactory, Factory toFactoryPos, inject, | ||
Visibility visibility: Visibility.DIRECT_CHILD}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this Visibility.LOCAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
On Thu, Jun 26, 2014 at 3:07 PM, Yegor notifications@github.com wrote:
In lib/core/annotation_src.dart:
@@ -2,35 +2,28 @@ library angular.core.annotation_src;
import "package:di/di.dart" show Injector, Visibility;
-RegExp _ATTR_NAME = new RegExp(r'[([^]]+)]$');
-const String SHADOW_DOM_INJECTOR_NAME = 'SHADOW_INJECTOR';
-skipShadow(Injector injector)
- => injector.name == SHADOW_DOM_INJECTOR_NAME ? injector.parent : injector;
+abstract class DirectiveBinder {- bind(key, {Function toFactory, Factory toFactoryPos, inject,
Visibility visibility: Visibility.DIRECT_CHILD});
Make this Visibility.LOCAL
—
Reply to this email directly or view it on GitHub
https://github.com/angular/angular.dart/pull/1178/files#r14269780.
When will this be merged? |
gradual migration. Originally authored by @yjbanov
gradual migration. Originally authored by @yjbanov
…o allow gradual migration. Originally authored by @yjbanov
View contains many injectors which are expensive in both speed and memory. The New DirectiveInjector assumes that there are no more than 10 directives per element and can be a lot more efficient than a array/hash lookup and those it can be faster as well as smaller. This change makes View instantiation speed 4x faster in Dartium VM. BREAKING CHANGE: - Injector no longer supports visibility - The Directive:module instead of returning Module now takes DirectiveModule (which supports visibility) - Application Injector and DirectiveInjector now have separate trees. (The root if DirectiveInjector is ApplicationInjector)
@mhevery I have submitted a PR to your repo to update the branch, see Remove usage of (deprecated) probe |
View contains many injectors which are expensive in both speed and memory. The
New DirectiveInjector assumes that there are no more than 10 directives
per element and can be a lot more efficient than a array/hash lookup and
those it can be faster as well as smaller. This change makes View
instantiation speed 4x faster in Dartium VM.
BREAKING CHANGE:
DirectiveModule (which supports visibility)
(The root of DirectiveInjector is ApplicationInjector)