[release/8.0-rc1] Improve filtering of candidate binding invocations in config binder gen #90746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #90619 to release/8.0-rc1
/cc @layomia
Customer impact
Customer may observe performance issues when editing large solutions with the generator enabled. This source generator uses a new activation pattern based on detection of method invocations. Review found performance refinements that can be made that we'd like to address in RC1 so that customers can use our final algorithm and validate that the performance is satisfactory.
Testing
Automated and manual tests provide coverage of the modified codepath. The average time spent in the generator goes down from ~225 ms to 102 ms, testing with Roslyn repo as a "large" solution. It's now on par with other generators. [Benchmark results].
Risk
Low & isolated to the modified off-by-default generator. We can't rule out the possibility of excluding actual binding invocations, but it shouldn't happen because every invocation should satisfy the updated constraints. Doing so would surface as a linker warning (and hopefully user feedback as a bug filed for us to fix).