diff --git a/packages/core/src/render3/instructions/control_flow.ts b/packages/core/src/render3/instructions/control_flow.ts index 33e38c7d4fd..c38dec3ab8f 100644 --- a/packages/core/src/render3/instructions/control_flow.ts +++ b/packages/core/src/render3/instructions/control_flow.ts @@ -440,13 +440,13 @@ class LiveCollectionLContainerImpl extends LiveCollection< new RepeaterContext(this.lContainer, value, index), {dehydratedView}, ); - this.operationsCounter?.recordCreate(); + ngDevMode && this.operationsCounter?.recordCreate(); return embeddedLView; } override destroy(lView: LView>): void { destroyLView(lView[TVIEW], lView); - this.operationsCounter?.recordDestroy(); + ngDevMode && this.operationsCounter?.recordDestroy(); } override updateValue(index: number, value: unknown): void { this.getLView(index)[CONTEXT].$implicit = value; @@ -454,7 +454,7 @@ class LiveCollectionLContainerImpl extends LiveCollection< reset(): void { this.needsIndexUpdate = false; - this.operationsCounter?.reset(); + ngDevMode && this.operationsCounter?.reset(); } updateIndexes(): void {