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

Optimize impcnvtab for newCTFE #9112

Closed
wants to merge 1 commit into from

Conversation

UplinkCoder
Copy link
Member

@UplinkCoder UplinkCoder commented Dec 21, 2018

Within the inner functions the 23232 byte large impcnvtab is used,
because of how delegates and closures are implemented in newCTFE
the full copy has to be done everytime the table is touched.
Therefore I opted to pass a pointer explicitly,
which improves compiletimes for newCTFE by a factor of 500

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @UplinkCoder!

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 fetch digger
dub run digger -- build "master + dmd#9112"

Within the inner functions the 23232 byte large impcnvtab is used,
because of how delegates and closures are implemented in newCTFE
the full copy has to be done everytime the table is touched.
Therefore I opted to pass a pointer explicitly,
which improves compiletimes for newCTFE by a factor of 500
@thewilsonator
Copy link
Contributor

thewilsonator commented Dec 21, 2018

Nice! What are the numbers for old CTFE?

@UplinkCoder
Copy link
Member Author

Haven't checked, probably little to nothing.

I don't know how they implement delegates.

@kinke
Copy link
Contributor

kinke commented Dec 21, 2018

This should most likely be the other way around - optimizing newCTFE instead, to prevent this ugliness and slowness (factor of 500?!) for similar code.

@UplinkCoder
Copy link
Member Author

currently I cannot devote resources to optimizing border cases like giant structs being passed via closure variables. It's quite hard to fix actually since newCTFE has no notion of a stack.

@kinke
Copy link
Contributor

kinke commented Dec 21, 2018

I fully understand, but I don't see a reason for this to be in upstream DMD, it just uglifies the code unless someone can show it improves the current interpreter performance too.

@thewilsonator
Copy link
Contributor

currently I cannot devote resources to optimizing border cases like giant structs being passed via closure variables. It's quite hard to fix actually since newCTFE has no notion of a stack.

border cases? Hello regex?

@Geod24
Copy link
Member

Geod24 commented Aug 10, 2019

This PR doesn't improve the code readability, and I don't think the change carries its weight.

@Geod24 Geod24 closed this Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants