From 8dc3f3647cbc474d008a5a3e1cb7f943a8c5802f Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Thu, 29 Aug 2019 11:42:18 +0200 Subject: [PATCH] perf(ivy): properly initialise global state in the element_text_create benchmark (#32397) PR Close #32397 --- packages/core/test/render3/perf/element_text_create/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/test/render3/perf/element_text_create/index.ts b/packages/core/test/render3/perf/element_text_create/index.ts index ce0fc11136baa3..eadb7d8cf3504c 100644 --- a/packages/core/test/render3/perf/element_text_create/index.ts +++ b/packages/core/test/render3/perf/element_text_create/index.ts @@ -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'; `
@@ -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);