-
-
Notifications
You must be signed in to change notification settings - Fork 108
feat: only emit Properties setter when it contains elements
#4407
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
Conversation
|
While I can run some tests, anything that relies on |
TUnit.Core.SourceGenerator/Utilities/MetadataGenerationHelper.cs
Outdated
Show resolved
Hide resolved
TUnit.Core.SourceGenerator/Utilities/MetadataGenerationHelper.cs
Outdated
Show resolved
Hide resolved
TUnit.Core.SourceGenerator/Utilities/MetadataGenerationHelper.cs
Outdated
Show resolved
Hide resolved
This is really annoying :( Does the compiler give any sort of error or anything? |
5f52e8c to
49faef8
Compare
👍 added. Was thinking of looking at the source generators performance as I assume they contribute to build times. Can't imagine it's possible to do any more incremental generator caching due to the nature of
Just checking; you do have an extension which lets you mass approve verify changes right? I don't want to waste your evening 😅 |
|
I wonder if it's failing to run on your machine for some reason (it's a source generator) |
Yep! |
Co-Authored-By: Claude Opus 4.5 <[email protected]>
SummaryThis PR optimizes source generator output by only emitting the Critical IssuesNone found ✅ SuggestionsMinor: Consider extracting loop body to helper methodThe PR author mentioned in the description: "I did think that the loop could be a dedicated helper method inside
However, this would require:
This is not blocking and can be done in a follow-up if desired. Observation: Consistent optimization patternsThe change is applied to both overloads of the property array generation methods ( Verification Checklist✅ Snapshot tests updated: All 100+ Verdict✅ APPROVE - Clean optimization that reduces generated code size without affecting functionality. |
Only emit
ClassMetadatareference setter when there are properties cutting down on unneeded generated code. Might have a tiny performance benefit 🤷 the JIT is hard to understand.I did think that the loop could be a dedicated helper method inside
TUnit.Core