-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Open
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercore: performance
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
Consider text interpolate in a template: {{ {name: 'Angular'} | json }}. Since we are declaring an object in a template, the generated code would be along the lines of: textInterpolate1(" ", pipeBind1(1, 1, pureFunction0(3, _c0)), " "); (where _c0 = ()=>({ name: "Angular" });.
Notice that we generate an arrow function wrapper around _c0 and the pureFunction call - even if {name: 'Angular'} is an object literal that will never change. We could optimize for such case and skip the pureFunction0 instruction call (alongside with the arrow function for _c0).
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version)
No response
Anything else?
Not the most common scenario / major optimization but still nice to have!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercore: performance