test(core): Add benchpress test for transplanted view change detection (#36001)

Adds a performance benchmark for transplanted views (those which are declared in one component and inserted into another).

PR Close #36001
This commit is contained in:
Andrew Scott
2020-03-10 15:46:09 -07:00
committed by Andrew Kushnir
parent 372a56a0c9
commit 63815b54f3
8 changed files with 327 additions and 0 deletions

View File

@ -0,0 +1,21 @@
/**
* @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 {getIntParameter} from '../util';
export const numViews = getIntParameter('viewCount');
export function newArray<T = any>(size: number): T[];
export function newArray<T>(size: number, value: T): T[];
export function newArray<T>(size: number, value?: T): T[] {
const list: T[] = [];
for (let i = 0; i < size; i++) {
list.push(value !);
}
return list;
}