-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: cache attribute symbols #478
Conversation
Codecov Report
@@ Coverage Diff @@
## main #478 +/- ##
==========================================
+ Coverage 92.08% 92.48% +0.39%
==========================================
Files 135 139 +4
Lines 4282 4455 +173
Branches 591 569 -22
==========================================
+ Hits 3943 4120 +177
+ Misses 225 221 -4
Partials 114 114
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this improvement 😊 The performance improvement is dependent on how many times attributes where used in the mapper declaration, therefore mappers with more attributes will benefit a lot more.
Removed all fields from The DI passes although I'm a little concerned I've broken .NET Framework by removing some of the null checks. Ran the Benchmarks a couple of times, both appear to be slower than the previous benchmarks. I wonder if the one of the more recent versions of mapperly have made it slower. Old:
New:
|
5ab47d0
to
674bee9
Compare
src/Riok.Mapperly/Descriptors/MappingBodyBuilders/NewInstanceObjectMemberMappingBodyBuilder.cs
Outdated
Show resolved
Hide resolved
674bee9
to
beb7a53
Compare
Thanks for the review! I've moved the properties, resued the logic between |
🎉 This PR is included in version 2.9.0-next.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Description
See #475
Add a
Dictionary<Type, INamedTypeSymbol?>
cache toWellKnownTypes
to optimizeAttributeDataAccessor
.Benchmarks
Benefits mappers with many mapping methods, saves 8ms for
LargeCompile
and saved 300 KB of memory. Doesn't look likeCompile
is effected.Old:
New: