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:

committed by
Andrew Kushnir

parent
372a56a0c9
commit
63815b54f3
21
modules/benchmarks/src/change_detection/util.ts
Normal file
21
modules/benchmarks/src/change_detection/util.ts
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user