perf(ivy): properly initialise global state in the element_text_create benchmark (#32397)

PR Close #32397
This commit is contained in:
Pawel Kozlowski 2019-08-29 11:42:18 +02:00 committed by Misko Hevery
parent 67d80f9ae8
commit 8dc3f3647c
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@ import {createTNode, createTView} from '../../../../src/render3/instructions/sha
import {ɵɵtext} from '../../../../src/render3/instructions/text';
import {RenderFlags} from '../../../../src/render3/interfaces/definition';
import {TNodeType, TViewNode} from '../../../../src/render3/interfaces/node';
import {resetComponentState} from '../../../../src/render3/state';
import {createAndRenderLView} from '../setup';
`<div>
@ -65,6 +66,9 @@ function testTemplate(rf: RenderFlags, ctx: any) {
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(-1, testTemplate, 21, 0, null, null, null, null);
// initialize global state
resetComponentState();
// create view once so we don't profile first template pass
createAndRenderLView(null, embeddedTView, viewTNode);