-
-
Notifications
You must be signed in to change notification settings - Fork 411
Removed version(unittest) blocks because they introduce big overhead #2888
Conversation
|
Thanks for your pull request and interest in making D better, @alexandrumc! 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 referencesYour 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 locallyIf 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 + druntime#2888" |
|
Can you define what big overhead you are witnessing ? |
Please see the description I added. Thanks. |
|
This doesn't fix the actual problem. The bug here is in DMD and this is just white-washing a tiny bit of the problem! There are likely many other occurrences of this in phobos or other libraries. |
Is
Unfortunately, yes. Also unfortunately, the fix in dmd is unlikely to be trivial (@alexandrumc has been looking into the root cause). Even if |
I know what the problem is. This is only a small part of the solution. The first step is to remove all the version(unittest) blocks, but I have to remove them in small incremental steps to be easier to review. |
|
@atilaneves : What's the plan with @alexandrumc : Thanks for adding the explanation. |
I'm not sure yet, I have to discuss it with Walter. |
1229620 to
c3902be
Compare
|
The issue with version(unittest) blocks specifically is that they generally are for testing the project or sometimes even only the module at hand. They are not usually for importers. version(unittest) blocks get semantic analysis even if they are irrelevant to the importer. unittest functions do not. There has to be a very very good reason to have a version(unittest), whereas just including unittests is fine. Thanks for the change, and hope to see more about the problem/solution described somewhere. |
How would that work? Wouldn't you need to include the module in the compilation to make use of said behavior/utilities, which would then enable |
user code:
library:
This is related to: dlang/phobos#6450