Optimization: Cache GetTypeByMetadataName
in AttributeDataAccessor
#475
Replies: 2 comments 2 replies
-
Thank you for profiling 😊 I'm not sure about the approach of #390, that's why I paused working on it. The idea was to read all configurations ahead of time instead of the current on demand approach. WDYT about it? |
Beta Was this translation helpful? Give feedback.
-
This got implemented in #478 |
Beta Was this translation helpful? Give feedback.
-
Profiling/benchmarking shows that
GetTypeByMetadataName
is slow and memory expensive.Mapperly should probably use a
Dictionary<Type, INamedTypeSymbol?>
cache inMappingBuilderContext
orWellKnownTypes
. This could be considered for #390 and verified with the benchmarks. Iirc it sped up the generation time for the integration tests by 20%.Beta Was this translation helpful? Give feedback.
All reactions