@ -5,16 +5,7 @@ import {PromiseWrapper} from 'angular2/src/facade/async';
|
||||
import {ListWrapper, Map, MapWrapper} from 'angular2/src/facade/collection';
|
||||
import {DateWrapper, Type, print, isPresent} from 'angular2/src/facade/lang';
|
||||
|
||||
import {
|
||||
Compiler,
|
||||
Component,
|
||||
Directive,
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
provide,
|
||||
Provider,
|
||||
ViewMetadata
|
||||
} from 'angular2/core';
|
||||
import {Compiler, Component, Directive, ViewContainerRef, bind, provide, Provider, ViewMetadata} from 'angular2/core';
|
||||
|
||||
import {ChangeDetectorGenConfig} from 'angular2/src/core/change_detection/change_detection';
|
||||
import {ViewResolver} from 'angular2/src/core/linker/view_resolver';
|
||||
@ -24,13 +15,12 @@ import {getIntParameter, bindAction} from 'angular2/src/testing/benchmark_util';
|
||||
function _createBindings(): Provider[] {
|
||||
var multiplyTemplatesBy = getIntParameter('elements');
|
||||
return [
|
||||
provide(ViewResolver,
|
||||
{
|
||||
useFactory: () => new MultiplyViewResolver(
|
||||
multiplyTemplatesBy,
|
||||
[BenchmarkComponentNoBindings, BenchmarkComponentWithBindings]),
|
||||
deps: []
|
||||
}),
|
||||
provide(ViewResolver, {
|
||||
useFactory:
|
||||
() => new MultiplyViewResolver(
|
||||
multiplyTemplatesBy, [BenchmarkComponentNoBindings, BenchmarkComponentWithBindings]),
|
||||
deps: []
|
||||
}),
|
||||
// Use DynamicChangeDetector as that is the only one that Dart supports as well
|
||||
// so that we can compare the numbers between JS and Dart
|
||||
provide(ChangeDetectorGenConfig, {useValue: new ChangeDetectorGenConfig(false, false, false)})
|
||||
@ -39,14 +29,12 @@ function _createBindings(): Provider[] {
|
||||
|
||||
export function main() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
bootstrap(CompilerAppComponent, _createBindings())
|
||||
.then((ref) => {
|
||||
var app = ref.hostComponent;
|
||||
bindAction('#compileNoBindings',
|
||||
measureWrapper(() => app.compileNoBindings(), 'No Bindings'));
|
||||
bindAction('#compileWithBindings',
|
||||
measureWrapper(() => app.compileWithBindings(), 'With Bindings'));
|
||||
});
|
||||
bootstrap(CompilerAppComponent, _createBindings()).then((ref) => {
|
||||
var app = ref.hostComponent;
|
||||
bindAction('#compileNoBindings', measureWrapper(() => app.compileNoBindings(), 'No Bindings'));
|
||||
bindAction(
|
||||
'#compileWithBindings', measureWrapper(() => app.compileWithBindings(), 'With Bindings'));
|
||||
});
|
||||
}
|
||||
|
||||
function measureWrapper(func, desc) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {SelectorMatcher} from "angular2/src/compiler/selector";
|
||||
import {CssSelector} from "angular2/src/compiler/selector";
|
||||
import {SelectorMatcher} from 'angular2/src/compiler/selector';
|
||||
import {CssSelector} from 'angular2/src/compiler/selector';
|
||||
import {StringWrapper, Math} from 'angular2/src/facade/lang';
|
||||
import {getIntParameter, bindAction} from 'angular2/src/testing/benchmark_util';
|
||||
import {BrowserDomAdapter} from 'angular2/src/platform/browser/browser_adapter';
|
||||
|
Reference in New Issue
Block a user