You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@thewilsonator Please wait with merging. I will investigate whether the measured 1% compile time increase is legit. If it is it might not be worth the memory savings of less than 2% (the overall memory includes the backend that uses about 30% of process memory in my tests).
rainers
changed the title
align allocations according to the actual type alignment, not an unconditional 16
WIP: align allocations according to the actual type alignment, not an unconditional 16
Aug 8, 2026
I cannot reproduce locally as results on a mobile processor tend to vary pretty much. From the last test here, the performance drop seems to come from the virtual call of TypeInfo.talign() to get the proper alignment. Unfortunately I've been falling into the trap that TypeInfo_Class.talign() does not provide the alignment of the instance, but only the reference. The instance alignment is nowhere to be found in the TypeInfo.
So for instances of new SomeClass, an alignment of 8 is assumed now. This keeps the memory savings, but also provides slightly better performance (~1%).
rainers
changed the title
WIP: align allocations according to the actual type alignment, not an unconditional 16
align allocations according to the actual type alignment, not an unconditional 16
Aug 9, 2026
Unfortunately on posix, real.alignof is 16, and that's used in RealExp and ComplexExp. So I added a register function for large alignments. Let's see how this performs.
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
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.
In my phobos-build-all-unittest this saves about 4% of memory of what the the front end needs.
AFAICT alignment deviates from
size_t.sizeofonly forIntegerExpwhen building for 32-bit, though.