Skip to content
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

Bugzilla 24700 - Don't search for mscoff .dp$B section over and over #16780

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

dkorpel
Copy link
Contributor

@dkorpel dkorpel commented Aug 13, 2024

Compile time goes down from 42.5s to 2.8s when compiling this:

static foreach (i; 0 .. 8_000)
    mixin("struct S"~i.stringof~" {float x;}");

__gshared int*[64_000] x;

Not closing the issue yet, because it's still doing O(n) section search in general making it slower than needed.

@dkorpel dkorpel added the Review:Industry Applies to PRs pertaining to industry applications of D label Aug 13, 2024
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @dkorpel! 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

Auto-close Bugzilla Severity Description
24700 normal MsCoffObj_getsegment is really slow O(n^2)

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#16780"

@dkorpel dkorpel added the Severity:Refactoring No semantic changes to code label Aug 13, 2024
@rikkimax
Copy link
Contributor

Assuming this is a singleton, it perhaps would make sense to have a table of them.

@dkorpel
Copy link
Contributor Author

dkorpel commented Aug 13, 2024

Please clarify 'this' and 'them'.

@rikkimax
Copy link
Contributor

this = .dp$B

them = sections

@dkorpel
Copy link
Contributor Author

dkorpel commented Aug 13, 2024

Yes, in the issue I mentioned how mscoff should use a hash table for sections just like elf, hence this is not closing the issue yet.

@dkorpel dkorpel merged commit 67227f0 into dlang:master Aug 14, 2024
40 of 41 checks passed
@dkorpel dkorpel deleted the mscoff-slow branch August 14, 2024 09:21
veelo pushed a commit to veelo/dmd that referenced this pull request Oct 24, 2024
dlang-bot pushed a commit that referenced this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review:Industry Applies to PRs pertaining to industry applications of D Severity:Refactoring No semantic changes to code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants