make Statement, StatementNoCaseNoDefault and Declaration use SumType#489
Open
WebFreak001 wants to merge 1 commit intodlang-community:masterfrom
Open
make Statement, StatementNoCaseNoDefault and Declaration use SumType#489WebFreak001 wants to merge 1 commit intodlang-community:masterfrom
WebFreak001 wants to merge 1 commit intodlang-community:masterfrom
Conversation
old Declaration code used algebraic, which is more efficiently replaced with sumtype. I replaced the mixin-generated properties with manual properties, since the code is very small for them anyway and helps them being shown in DCD Since SumType works with well-defiend types, opEquals and visitIfNotNull was trivial to implement. Saves around 0-3 MB of actual peak RAM in a ~170 MB test environment (could just be fluctuations how much it actually is, but it _will_ definitely include some RAM savings, since we no longer store a bunch of nulls for common types) Easy backwards-compatible improvement I think. Made setters backwards-incompatible on purpose, since we don't want accidental assignment of 2 different types on the same sumtype.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #489 +/- ##
==========================================
+ Coverage 83.49% 83.53% +0.04%
==========================================
Files 11 11
Lines 8483 8541 +58
==========================================
+ Hits 7083 7135 +52
- Misses 1400 1406 +6
Continue to review full report in Codecov by Sentry.
|
WebFreak001
commented
Mar 22, 2023
| * | $(LITERAL 'pure') | ||
| * | $(LITERAL 'ref') | ||
| * | $(LITERAL '___gshared') | ||
| * | $(LITERAL '__gshared') |
Member
Author
There was a problem hiding this comment.
maybe this was intended? It pops up here and there, need to investigate what this is about
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
old Declaration code used algebraic, which is more efficiently replaced with sumtype.
I replaced the mixin-generated properties with manual properties, since the code is very small for them anyway and helps them being shown in DCD
Since SumType works with well-defiend types, opEquals and visitIfNotNull was trivial to implement.
Saves around 0-3 MB of actual peak RAM in a ~170 MB test environment (could just be fluctuations how much it actually is, but it will definitely include some RAM savings, since we no longer store a bunch of nulls for common types)
Easy backwards-compatible improvement I think.
Made setters backwards-incompatible on purpose, since we don't want accidental assignment of 2 different types on the same sumtype.