Skip to content

Refactor joiner to reduce symbol bloat. #5610

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

Closed
wants to merge 1 commit into from

Conversation

quickfur
Copy link
Member

@quickfur quickfur commented Jul 14, 2017

Using Steven Schveighoffer's "horcrux" trick. In my range-heavy project, this single change resulted in a 50% reduction in executable size(!). This is on top of the reductions already realized by my own application of the same trick (see forum discussion below).

Relevant discussions:

This PR is just one of many to come. Some of the most common range functions in Phobos are Voldemort types, which cause nasty symbol size bloat. These PRs aim to reduce this bloat and make heavily ranged-based code more viable for D. (At least until the DMD PR is pulled. But this problem is quickly becoming a showstopper for me in the meantime, because yesterday I started running into DMD's 10MB symbol size limit. Not to mention ELF errors caused by excessively large symbols.)

Using Steven Schveighoffer's "horcrux" trick.  In my range-heavy
project, this single change resulted in a 50% reduction in executable
size(!).
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @quickfur!

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.

quickfur pushed a commit to quickfur/phobos that referenced this pull request Jul 14, 2017
@andralex
Copy link
Member

Does @rainers recent work on compressed mangling help with this?

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

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

This looks like a transformation that could be done automatically by dmd, not top of what dlang/dmd#5855 would do to improve the encoding of symbols, though for the time being we need workarounds such as this, so LGTM.

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

I agree with @ZombineDev here, the problem is real and this is a nice solution to solve this problem for the critical bits for the time being (I will comment more on the other PR with the longer discussion).

@rainers
Copy link
Member

rainers commented Jul 15, 2017

Does @rainers recent work on compressed mangling help with this?

Yes, the new mangling never repeats a type in the mangling.

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.

7 participants