Config generator emits lambdas for error path that force allocation on success path #90971
Labels
area-Extensions-Configuration
help wanted
[up-for-grabs] Good issue for external contributors
in-pr
There is an active PR which will close this issue when it is merged
Priority:2
Work that is important, but not critical for the release
source-generator
Indicates an issue with a source generator feature
tenet-performance
Performance related issue
Milestone
Consider a method like:
That results in this
BindCore
method being emitted:That
ParseInt
call closes over theconfiguration
parameter, which means the compiler will lift theconfiguration
parameter to a display class and generate code like this:That means we're allocating a
<>c__DisplayClass15_0
object on all invocation, even though that lambda causing the closure is only used byParseInt
when parsing fails and an exception is thrown and caught.The text was updated successfully, but these errors were encountered: