From d5d9971c28f38d1cda10c1d2c197f5432ee2a6e8 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Wed, 5 Feb 2020 10:48:13 -0800 Subject: [PATCH] refactor(benchpress): delete outdated/unused folder (#35147) PR Close #35147 --- .../benchmarks/e2e_test/old/compiler_perf.ts | 44 --------- modules/benchmarks/e2e_test/old/costs_perf.ts | 47 ---------- modules/benchmarks/e2e_test/old/di_perf.ts | 91 ------------------- .../e2e_test/old/largetable_perf.ts | 51 ----------- .../old/naive_infinite_scroll_perf.ts | 38 -------- .../old/naive_infinite_scroll_spec.ts | 63 ------------- .../benchmarks/e2e_test/old/page_load_perf.ts | 45 --------- .../benchmarks/e2e_test/old/selector_perf.ts | 48 ---------- .../e2e_test/old/static_tree_perf.ts | 50 ---------- 9 files changed, 477 deletions(-) delete mode 100644 modules/benchmarks/e2e_test/old/compiler_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/costs_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/di_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/largetable_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts delete mode 100644 modules/benchmarks/e2e_test/old/page_load_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/selector_perf.ts delete mode 100644 modules/benchmarks/e2e_test/old/static_tree_perf.ts diff --git a/modules/benchmarks/e2e_test/old/compiler_perf.ts b/modules/benchmarks/e2e_test/old/compiler_perf.ts deleted file mode 100644 index 1ab1bfd0d9..0000000000 --- a/modules/benchmarks/e2e_test/old/compiler_perf.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 compiler benchmark', function() { - - const URL = 'benchmarks/src/compiler/compiler_benchmark.html'; - - afterEach(verifyNoBrowserErrors); - - it('should log withBindings stats', async() => { - browser.sleep(1000); - runBenchmark({ - url: URL, - id: 'ng2.compile.withBindings', - params: [{name: 'elements', value: 150, scale: 'linear'}], - work: function() { - browser.executeScript('document.querySelector("#compileWithBindings").click()'); - browser.sleep(500); - } - }); - }); - - it('should log noBindings stats', async() => { - browser.sleep(1000); - runBenchmark({ - url: URL, - id: 'ng2.compile.noBindings', - params: [{name: 'elements', value: 150, scale: 'linear'}], - work: function() { - browser.executeScript('document.querySelector("#compileNoBindings").click()'); - browser.sleep(500); - } - }); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/costs_perf.ts b/modules/benchmarks/e2e_test/old/costs_perf.ts deleted file mode 100644 index fdbab55936..0000000000 --- a/modules/benchmarks/e2e_test/old/costs_perf.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 cost benchmark', function() { - - const URL = 'benchmarks/src/costs/index.html'; - - // Number of components to create in a single iteration - const benchmarkSize = 200; - - afterEach(verifyNoBrowserErrors); - - it('should log stats for baseline (plain components)', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#reset', '#createPlainComponents'], - id: 'ng2.costs.baseline', - params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }); - }); - - it('should log stats for components with decorators', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#reset', '#createComponentsWithDirectives'], - id: 'ng2.costs.decorators', - params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }); - }); - - it('should log stats for dynamic components', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#reset', '#createDynamicComponents'], - id: 'ng2.costs.dynamic', - params: [{name: 'size', value: benchmarkSize, scale: 'linear'}] - }); - }); -}); diff --git a/modules/benchmarks/e2e_test/old/di_perf.ts b/modules/benchmarks/e2e_test/old/di_perf.ts deleted file mode 100644 index 5cb36f06d2..0000000000 --- a/modules/benchmarks/e2e_test/old/di_perf.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 di benchmark', function() { - - const URL = 'benchmarks/src/di/di_benchmark.html'; - - afterEach(verifyNoBrowserErrors); - - it('should log the stats for getByToken', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#getByToken'], - id: 'ng2.di.getByToken', - params: [{name: 'iterations', value: 20000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for injection (in ms)'}, - waitForAngular2: false - }); - }); - - it('should log the stats for getByKey', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#getByKey'], - id: 'ng2.di.getByKey', - params: [{name: 'iterations', value: 20000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for injection (in ms)'}, - waitForAngular2: false - }); - }); - - it('should log the stats for getChild', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#getChild'], - id: 'ng2.di.getChild', - params: [{name: 'iterations', value: 20000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for getChild (in ms)'}, - waitForAngular2: false - }); - }); - - it('should log the stats for instantiate', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#instantiate'], - id: 'ng2.di.instantiate', - params: [{name: 'iterations', value: 10000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for instantiate (in ms)'}, - waitForAngular2: false - }); - }); - - /** - * This benchmark measures the cost of creating a new injector with a mix - * of binding types: Type, unresolved, unflattened. - */ - it('should log the stats for createVariety', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#createVariety'], - id: 'ng2.di.createVariety', - params: [{name: 'iterations', value: 10000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for createVariety (in ms)'}, - waitForAngular2: false - }); - }); - - /** - * Same as 'createVariety' benchmark but operates on fully resolved bindings. - */ - it('should log the stats for createVarietyResolved', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#createVarietyResolved'], - id: 'ng2.di.createVarietyResolved', - params: [{name: 'iterations', value: 10000, scale: 'linear'}], - microMetrics: {'injectAvg': 'avg time for createVarietyResolved (in ms)'}, - waitForAngular2: false - }); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/largetable_perf.ts b/modules/benchmarks/e2e_test/old/largetable_perf.ts deleted file mode 100644 index dcc30557cc..0000000000 --- a/modules/benchmarks/e2e_test/old/largetable_perf.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 largetable benchmark', function() { - - const URL = 'benchmarks/src/largetable/largetable_benchmark.html'; - - afterEach(verifyNoBrowserErrors); - - // Not yet implemented: - // 'ngBind', - // 'ngBindOnce', - // 'ngBindFn', - // 'ngBindFilter', - // 'interpolationFilter' - - ['interpolation', 'interpolationAttr', 'interpolationFn'].forEach(function(benchmarkType) { - it('should log the ng stats with: ' + benchmarkType, async() => { - runClickBenchmark({ - url: URL, - buttons: ['#ng2DestroyDom', '#ng2CreateDom'], - id: 'ng2.largetable.' + benchmarkType, - params: [ - {name: 'rows', value: 20, scale: 'sqrt'}, {name: 'columns', value: 20, scale: 'sqrt'}, - {name: 'benchmarkType', value: benchmarkType} - ] - }); - }); - }); - - it('should log the baseline stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#baselineDestroyDom', '#baselineCreateDom'], - id: 'baseline.largetable', - params: [ - {name: 'rows', value: 100, scale: 'sqrt'}, {name: 'columns', value: 20, scale: 'sqrt'}, - {name: 'benchmarkType', value: 'baseline'} - ] - }); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts deleted file mode 100644 index df59e87fbf..0000000000 --- a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_perf.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 naive infinite scroll benchmark', function() { - - const URL = 'benchmarks/src/naive_infinite_scroll/index.html'; - - afterEach(verifyNoBrowserErrors); - - [1, 2, 4].forEach(function(appSize) { - it('should run scroll benchmark and collect stats for appSize = ' + appSize, async() => { - runBenchmark({ - url: URL, - id: 'ng2.naive_infinite_scroll', - work: function() { - browser.wait( - protractor.until.elementLocated(protractor.By.css('body /deep/ #scrollDiv')), 5000); - $('#reset-btn').click(); - $('#run-btn').click(); - browser.wait(protractor.until.elementLocated(protractor.By.css('#done')), 10000); - }, - params: [ - {name: 'appSize', value: appSize}, {name: 'iterationCount', value: 20, scale: 'linear'}, - {name: 'scrollIncrement', value: 40} - ] - }); - }); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts b/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts deleted file mode 100644 index 68c7bf6fb4..0000000000 --- a/modules/benchmarks/e2e_test/old/naive_infinite_scroll_spec.ts +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 naive infinite scroll benchmark', function() { - - const URL = 'benchmarks/src/naive_infinite_scroll/index.html?appSize=3'; - - afterEach(verifyNoBrowserErrors); - - it('should not throw errors', async() => { - browser.get(URL); - const expectedRowCount = 18; - const expectedCellsPerRow = 27; - const allScrollItems = 'scroll-app #testArea scroll-item'; - const cells = `${ allScrollItems } .row *`; - const stageButtons = `${ allScrollItems } .row stage-buttons button`; - - const count = function(selector) { - return browser.executeScript( - `return ` + - `document.querySelectorAll("${ selector }").length;`); - }; - - const clickFirstOf = function(selector) { - return browser.executeScript(`document.querySelector("${ selector }").click();`); - }; - - const firstTextOf = function(selector) { - return browser.executeScript( - `return ` + - `document.querySelector("${ selector }").innerText;`); - }; - - // Make sure rows are rendered - count(allScrollItems).then(function(c) { expect(c).toEqual(expectedRowCount); }); - - // Make sure cells are rendered - count(cells).then(function(c) { expect(c).toEqual(expectedRowCount * expectedCellsPerRow); }); - - // Click on first enabled button and verify stage changes - firstTextOf(`${ stageButtons }:enabled`).then(function(text) { - expect(text).toEqual('Pitched'); - clickFirstOf(`${ stageButtons }:enabled`).then(function() { - firstTextOf(`${ stageButtons }:enabled`).then((text) => expect(text).toEqual('Won')); - }); - }); - - $('#reset-btn').click(); - $('#run-btn').click(); - browser.wait(() => { - return $('#done').getText().then(function() { return true; }, function() { return false; }); - }, 10000); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/page_load_perf.ts b/modules/benchmarks/e2e_test/old/page_load_perf.ts deleted file mode 100644 index ee52cd8bf9..0000000000 --- a/modules/benchmarks/e2e_test/old/page_load_perf.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from 'angular2/src/testing/perf_util'; - -describe('ng2 largetable benchmark', function() { - - const URL = 'benchmarks/src/page_load/page_load.html'; - const runner = global['benchpressRunner']; - - afterEach(verifyNoBrowserErrors); - - - it('should log the load time', async() => { - runner - .sample({ - id: 'loadTime', - prepare: null, - microMetrics: null, - userMetrics: - {loadTime: 'The time in milliseconds to bootstrap', someConstant: 'Some constant'}, - bindings: [ - benchpress.bind(benchpress.SizeValidator.SAMPLE_SIZE).toValue(2), - benchpress.bind(benchpress.RegressionSlopeValidator.SAMPLE_SIZE).toValue(2), - benchpress.bind(benchpress.RegressionSlopeValidator.METRIC).toValue('someConstant') - ], - execute: () => { browser.get(URL); } - }) - .then(report => { - expect(report.completeSample.map(val => val.values.someConstant) - .every(v => v === 1234567890)) - .toBe(true); - expect(report.completeSample.map(val => val.values.loadTime) - .filter(t => typeof t === 'number' && t > 0) - .length) - .toBeGreaterThan(1); - }) - .then(done); - }); -}); diff --git a/modules/benchmarks/e2e_test/old/selector_perf.ts b/modules/benchmarks/e2e_test/old/selector_perf.ts deleted file mode 100644 index 102a5ef234..0000000000 --- a/modules/benchmarks/e2e_test/old/selector_perf.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 selector benchmark', function() { - - const URL = 'benchmarks/src/compiler/selector_benchmark.html'; - - afterEach(verifyNoBrowserErrors); - - it('should log parse stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#parse'], - id: 'ng2.selector.parse', - params: [{name: 'selectors', value: 10000, scale: 'linear'}], - waitForAngular2: false - }); - }); - - it('should log addSelectable stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#addSelectable'], - id: 'ng2.selector.addSelectable', - params: [{name: 'selectors', value: 10000, scale: 'linear'}], - waitForAngular2: false - }); - }); - - it('should log match stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#match'], - id: 'ng2.selector.match', - params: [{name: 'selectors', value: 10000, scale: 'linear'}], - waitForAngular2: false - }); - }); - -}); diff --git a/modules/benchmarks/e2e_test/old/static_tree_perf.ts b/modules/benchmarks/e2e_test/old/static_tree_perf.ts deleted file mode 100644 index 33f7ac3b01..0000000000 --- a/modules/benchmarks/e2e_test/old/static_tree_perf.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {verifyNoBrowserErrors} from '@angular/testing/src/e2e_util'; -import {runClickBenchmark} from '@angular/testing/src/perf_util'; - -describe('ng2 static tree benchmark', function() { - - const URL = 'benchmarks/src/static_tree/tree_benchmark.html'; - - afterEach(verifyNoBrowserErrors); - - it('should log the ng stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#ng2DestroyDom', '#ng2CreateDom'], - id: 'ng2.static.tree.create.plain', - params: [] - }); - }); - - it('should log the ng stats (update)', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#ng2CreateDom'], - id: 'ng2.static.tree.update', - params: [], - }); - }); - - it('should log the baseline stats', async() => { - runClickBenchmark({ - url: URL, - buttons: ['#baselineDestroyDom', '#baselineCreateDom'], - id: 'baseline.static.tree.create', - params: [] - }); - }); - - it('should log the baseline stats (update)', async() => { - runClickBenchmark( - {url: URL, buttons: ['#baselineCreateDom'], id: 'baseline.static.tree.update', params: []}); - }); - -});