-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Fix Issue 8156 - Optimize string comdats name generation (Windows) #11555
Conversation
|
Thanks for your pull request and interest in making D better, @BorisCarvajal! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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
|
I think your benchmark should have multiple modules that import bigfile. Compile separately and link together. There should be no observed executable size regressions. |
ee2c013 to
3bfa5b7
Compare
I just tested with the corrections and there's no size regressions. |
3bfa5b7 to
6792990
Compare
|
I have serious reservations about this. The hash in The purpose of the md5 hash is to ensure uniqueness - not just within the object file, but across all the object files linked together (so identical strings share storage). The hash has to be unique. Using I recommend instead looking at speeding up the md5 calculation. Here is some work done on speeding up sha: |
6792990 to
656b810
Compare
|
@WalterBright That concern is valid, so I've discarded the md5 replacement, still the other changes(*) bring like 55% speed up (DMD not in release mode though). (changes):
|
|
@MoonlightSentinel, Why the "needs tests" tag? Everything should already be covered by the test suite. |
656b810 to
08a47a9
Compare
08a47a9 to
3af440b
Compare
|
Can this be merged? |
Replace md5 checksum with the already calculated hash in, and don't callstringTabmangleToBufferin advance if we know the string is long enough .Test case:
Tested using
-c -J. test.d --DRT-gcopt=profile:1 -lowmemon QEMU.Old behavior:
-m32switch:Time: 3m07s, RAM: 779mb <-- really slow, mostly handled by #11554
-m32mscoffswitch:Time: 4.7s, RAM: 779mb
-m64switch:Time: 4.7s, RAM: 779mb
New behavior (DMD built with #11554 patch too):
-m32switch:Time: 2.1s, RAM: 319mb
-m32mscoffswitch:Time: 2s, RAM: 319mb
-m64switch:Time: 2s, RAM: 319mb