diff --git a/modules/angular2/src/test_lib/perf_util.es6 b/modules/angular2/src/test_lib/perf_util.es6 index 9361642af0..226414f425 100644 --- a/modules/angular2/src/test_lib/perf_util.es6 +++ b/modules/angular2/src/test_lib/perf_util.es6 @@ -23,7 +23,14 @@ function runBenchmark(config) { return getScaleFactor(browser.params.benchmark.scaling).then(function(scaleFactor) { var description = {}; var urlParams = []; - config.params.forEach(function(param) { + var microIterations = config.microIterations || 0; + var params = config.params || []; + if (microIterations) { + params = params.concat([{ + name: 'iterations', value: microIterations, scale: 'linear' + }]); + } + params.forEach(function(param) { var name = param.name; var value = applyScaleFactor(param.value, scaleFactor, param.scale); urlParams.push(name + '=' + value); @@ -35,6 +42,7 @@ function runBenchmark(config) { id: config.id, execute: config.work, prepare: config.prepare, + microIterations: microIterations, bindings: [ benchpress.bind(benchpress.Options.SAMPLE_DESCRIPTION).toValue(description) ] diff --git a/modules/benchmarks/e2e_test/change_detection_perf.es6 b/modules/benchmarks/e2e_test/change_detection_perf.es6 index 484dda569b..99eb82645f 100644 --- a/modules/benchmarks/e2e_test/change_detection_perf.es6 +++ b/modules/benchmarks/e2e_test/change_detection_perf.es6 @@ -12,8 +12,9 @@ describe('ng2 change detection benchmark', function () { buttons: ['#ng2ChangeDetectionDynamic'], id: 'ng2.changeDetection.dynamic', params: [{ - name: 'numberOfChecks', value: 900000, scale: 'linear' - }] + name: 'numberOfChecks', value: 900000 + }], + microIterations: 20 }).then(done, done.fail); }); @@ -23,8 +24,9 @@ describe('ng2 change detection benchmark', function () { buttons: ['#ng2ChangeDetectionJit'], id: 'ng2.changeDetection.jit', params: [{ - name: 'numberOfChecks', value: 900000, scale: 'linear' - }] + name: 'numberOfChecks', value: 900000 + }], + microIterations: 20 }).then(done, done.fail); }); @@ -34,8 +36,9 @@ describe('ng2 change detection benchmark', function () { buttons: ['#baselineChangeDetection'], id: 'baseline.changeDetection', params: [{ - name: 'numberOfChecks', value: 900000, scale: 'linear' - }] + name: 'numberOfChecks', value: 900000 + }], + microIterations: 20 }).then(done, done.fail); }); diff --git a/modules/benchmarks/e2e_test/di_perf.es6 b/modules/benchmarks/e2e_test/di_perf.es6 index 1158de8eb2..d987a20da0 100644 --- a/modules/benchmarks/e2e_test/di_perf.es6 +++ b/modules/benchmarks/e2e_test/di_perf.es6 @@ -13,7 +13,8 @@ describe('ng2 di benchmark', function () { id: 'ng2.di.getByToken', params: [{ name: 'iterations', value: 20000, scale: 'linear' - }] + }], + microIterations: 20000 }).then(done, done.fail); }); @@ -22,9 +23,7 @@ describe('ng2 di benchmark', function () { url: URL, buttons: ['#getByKey'], id: 'ng2.di.getByKey', - params: [{ - name: 'iterations', value: 20000, scale: 'linear' - }] + microIterations: 20000 }).then(done, done.fail); }); @@ -33,9 +32,7 @@ describe('ng2 di benchmark', function () { url: URL, buttons: ['#getChild'], id: 'ng2.di.getChild', - params: [{ - name: 'iterations', value: 20000, scale: 'linear' - }] + microIterations: 20000 }).then(done, done.fail); }); @@ -44,9 +41,7 @@ describe('ng2 di benchmark', function () { url: URL, buttons: ['#instantiate'], id: 'ng2.di.instantiate', - params: [{ - name: 'iterations', value: 10000, scale: 'linear' - }] + microIterations: 10000 }).then(done, done.fail); }); diff --git a/modules/benchmarks/e2e_test/element_injector_perf.es6 b/modules/benchmarks/e2e_test/element_injector_perf.es6 index 2e93597205..f92b769a8b 100644 --- a/modules/benchmarks/e2e_test/element_injector_perf.es6 +++ b/modules/benchmarks/e2e_test/element_injector_perf.es6 @@ -11,9 +11,7 @@ describe('ng2 element injector benchmark', function () { url: URL, buttons: ['#instantiate'], id: 'ng2.elementInjector.instantiate', - params: [{ - name: 'iterations', value: 20000, scale: 'linear' - }] + microIterations: 20000 }).then(done, done.fail); }); @@ -22,9 +20,7 @@ describe('ng2 element injector benchmark', function () { url: URL, buttons: ['#instantiateDirectives'], id: 'ng2.elementInjector.instantiateDirectives', - params: [{ - name: 'iterations', value: 20000, scale: 'linear' - }] + microIterations: 20000 }).then(done, done.fail); }); diff --git a/modules/benchmarks/src/change_detection/change_detection_benchmark.html b/modules/benchmarks/src/change_detection/change_detection_benchmark.html index 6875f1ad84..ea5618c07a 100644 --- a/modules/benchmarks/src/change_detection/change_detection_benchmark.html +++ b/modules/benchmarks/src/change_detection/change_detection_benchmark.html @@ -5,6 +5,8 @@