-
-
Notifications
You must be signed in to change notification settings - Fork 143
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: Implement custom source formatting to improve performance #706
Conversation
Codecov Report
@@ Coverage Diff @@
## main #706 +/- ##
==========================================
+ Coverage 90.82% 91.15% +0.32%
==========================================
Files 180 198 +18
Lines 6313 6555 +242
Branches 807 815 +8
==========================================
+ Hits 5734 5975 +241
+ Misses 390 389 -1
- Partials 189 191 +2
📣 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.
Really impressive stuff, a 38% improvement is crazy good, it's probably on par with a string builder version. IQueryable
expressions are way easier to read.
How long did this take 😨
SourceEmitter.Build
now takes 15% of the time. Iirc used to take 50%-60% of the runtime.
- After a block no empty line is inserted
- Initializer blocks each assignment is on its own line (even for older Roslyn versions) and has a trailing comma
Is this intentional or a side effect? I had a similar issue with empty lines in my SourceWriter
project
I haven't read the whole thing but I've added a couple of comments
test/Riok.Mapperly.IntegrationTests/Riok.Mapperly.IntegrationTests.csproj
Outdated
Show resolved
Hide resolved
@TimothyMakkison thanks for you feedback 😊 |
🎉 This PR is included in version 3.2.0-next.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Implement custom source formatting to improve performance
Description
Implements custom source formatting during the creation of the syntax nodes.
This PR slightly changes the formatting of a few things to improve performance / readability:
Performance current main
Performance with this PR
Improvement of about 38% for our LargeCompile case and small memory improvements 🚀
The PR is pretty big, although a lot of it are just reformatted test files and namespace moves.
Checklist