[WIP] perf(View): Improve View instantiation speed and memory consumption.

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 of DirectiveInjector is ApplicationInjector)
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>.
>