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

eliminate quadratic behavior in updaterd() #6356

Merged
merged 1 commit into from
Dec 23, 2016

Conversation

WalterBright
Copy link
Member

This precomputes the vector needed for updaterd(), whereas before it was computed on the fly. It did that to minimize memory consumption, but that is much less of factor these days. So we're trading memory consumption for speed.

In some pathological cases, i.e. https://issues.dlang.org/show_bug.cgi?id=7157, this change doubles the speed of the optimization pass. The time taken is still quadratic, though. accumaecpx() remains quadratic.

@MartinNowak
Copy link
Member

Auto-merge toggled on

@andralex
Copy link
Member

cool beans

@MartinNowak MartinNowak merged commit c68d9fe into dlang:master Dec 23, 2016
@WalterBright
Copy link
Member Author

It also seems to produce about a 5% speed improvement in compiling ordinary code.

@WalterBright WalterBright deleted the add-dnunambig branch December 23, 2016 17:54
@wilzbach
Copy link
Member

It also seems to produce about a 5% speed improvement in compiling ordinary code.

Would be interesting to see whether @CyberShadow's Is D slim yet is able to detect this as well, but it currently throws an error at me :/

@MartinNowak
Copy link
Member

Hardly any visible effect on the test suite btw.

@JackStouffer
Copy link
Member

@MartinNowak probably because as a work around, people moved away from functions which slowed down DMD a lot.

@WalterBright
Copy link
Member Author

The test suite is designed to consist of small functions. The quadratic behavior does not move to the fore unless the function is quite large. It's usually considered bad form to write gigantic functions, so it was rarely a problem.

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