Skip to content

optimize memory layout of aggregates#11370

Merged
dlang-bot merged 1 commit intomasterfrom
unknown repository
Jul 5, 2020
Merged

optimize memory layout of aggregates#11370
dlang-bot merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jul 4, 2020

On x86_64, StructDeclaration stood on 569 bytes, now 560, which saves allocation of a small block, simply by reordering fields.
Note that this time the gain is always negligible as you dont have thousands of different struct in a project.
My methodology to test (/usr/bin/time -v) doesnt even show anything tangible.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @NilsLankila! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11370"

@thewilsonator
Copy link
Contributor

Headers.

@ghost ghost requested a review from ibuclaw as a code owner July 4, 2020 16:14
@ghost
Copy link
Author

ghost commented Jul 4, 2020

Headers ok now

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good aside the merge conflict

On x86_64, StructDeclaration stood on 569 bytes, now 560 which saves allocation of a small block.
@ghost
Copy link
Author

ghost commented Jul 5, 2020

conflicts solved

@dlang-bot dlang-bot merged commit 457074e into dlang:master Jul 5, 2020
@ghost ghost deleted the agg-layout-mem branch July 9, 2020 03:40
@ibuclaw
Copy link
Member

ibuclaw commented Jul 9, 2020

This caused a regression.

$ gdc a.d
d21: error: struct ‘gcc.builtins.__va_list_tag’ circular or forward reference

@ghost
Copy link
Author

ghost commented Jul 9, 2020

bad headers ?

ibuclaw added a commit to ibuclaw/dmd that referenced this pull request Jul 9, 2020
@ghost
Copy link
Author

ghost commented Jul 9, 2020

can be caused by the rebase too ?

@ibuclaw
Copy link
Member

ibuclaw commented Jul 9, 2020

Yes, bad headers. It could have been avoided if tests are added whenever public fields get moved around.

#11394

@ibuclaw
Copy link
Member

ibuclaw commented Jul 9, 2020

can be caused by the rebase too ?

Can't say. But they are clearly in the wrong order when comparing C++ and D definitions.

@ghost
Copy link
Author

ghost commented Jul 9, 2020

yeah anyway sorry, thanks for the fixup.

ghost pushed a commit to WalterBright/dmd that referenced this pull request Aug 12, 2020
UplinkCoder pushed a commit to UplinkCoder/dmd that referenced this pull request Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants