Commit 0690fd0
committed
refactor: reduce PropertyInjector complexity and allocations
- Cache PropertyInfo lookups via static ConcurrentDictionary to avoid
repeated reflection calls in source-gen paths
- Extract InjectPropertiesFromPlanAsync and RecurseIntoPropertyValueAsync
to reduce cyclomatic complexity of InjectPropertiesRecursiveAsync
- Extract CreateSourceGeneratedDataGeneratorMetadata to fix duplicate
PropertyHelper.GetPropertyInfo call (was called twice per property)
- Extract RentVisitedDictionary/ReturnVisitedDictionary for pool ops
- Use PropertyInitializationContext factory methods instead of manual
object initializers, reducing duplication across 4 call sites
- Replace foreach with indexed for loops to avoid enumerator allocations
- Simplify GetInitializedDataSourceAsync with null-coalescing operator
- Remove redundant condition checks where HasProperties already implies
properties exist
- Convert ResolveAndCachePropertiesCoreAsync from async to synchronous
Task return to avoid unnecessary state machine allocation
Closes #48971 parent e36184a commit 0690fd0
1 file changed
Lines changed: 171 additions & 170 deletions
0 commit comments