-
-
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 19550 - [REG 2.078] Massive compiler backend slowdown #11085
Conversation
Fixes typo which caused a redundant O(N^2) slowdown.
|
Thanks for your pull request and interest in making D better, @WalterWaldron! 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
|
|
2.078 is really old so this doesn't seem urgent. The current beta has also started and is a bit shorter, next release will follow suit on July 1st. |
My understanding is as follows: If adding a test is required, any help is appreciated since I don't know how to add performance tests to the test suite. |
|
This is the way the code should have been written in the first place. @WalterWaldron caught my mistake. Thanks! |
@MoonlightSentinel - maybe we could add machinery to run expensive tests? We don't want to run tests that take >2 minutes to compile by default, it already takes long enough to run CI. Likewise, using timeout to enforce a limit on compile time may result in sporadic failures, unless we use a value high enough that it can never be a false positive (e.g 600 seconds) |
|
We could use the same approach taken for Should this benchmark utility target |
Well you have compile-time expensive, and run-time expensive. It makes no sense that a fail compilation test should ever take more than 5 seconds to error and bail out, let alone 2 minutes. |
|
Agreed, |
First thing that comes to mind is |
|
That works if we only want to disable expensive tests on certain test runners. But given your previous point:
I would also consider a new test parameter which declares a timeout, e.g. and maybe support a default value: Tests declaring this parameter could then be disabled as you suggested. |
|
Please be cautious about adding timing based tests to CI. We do not want to see random PR failures because of environmental issues we have no control over on the various CIs. I'd say a better metric is to measure the number of calls and ensure they don't go past a certain count (i.e. not quadratic). |
This is why I said default disabled unless explicitly turned on in the environment.
This would require building the compiler with profiling turned on, and does not help with CI taking > 1 hour to run because of individual test files taking > 10 minutes to compile. It is already floating around the 35 minute mark on the old windows auto tester box. |
|
As the timing difference with/without this change is 1m5s -> 600ms, I don't think there can be any false positive if the compilation time regresses to being greater than 10-15 seconds again. But again, testing this as part of the regular CI is not something I'd recommend, however much we care about compiler performance. |
Ah, that's a bit different than what I was thinking. Yeah, saying something like 10 seconds is probably fine. But it will happen that some PRs fail if this is part of CI. It is annoying these days we have to restart a lot of CI tests, many times just due to environmental failures.
then it becomes something that's not tested, i.e. useless. |
fix Issue 19550 - [REG 2.078] Massive compiler backend slowdown Signed-off-by: Martin Krejcirik <mk@krej.cz>
Fixes typo which caused a redundant O(N^2) slowdown.
I set the branch to master, I'll leave it to @MartinNowak to decide whether this should be in stable.