-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
dub now takes 2x longer to compile #2600
Comments
Timing a from-scratch build is not really a fair assessment. Absolute compile time is not as important as incremental one. |
None of that should double the build time from 5 seconds to 10 seconds, none There is a serious problem with the code added between 1.29.2 and 1.30.0 and this needs to be investigated and fixed, i'll try my best to help, but "WONTFIX" is giving bad signals |
I'd also say that the Configy code and its instantiations are probably the reason. It's just really easy to push compile times like that with introspection heavy code. But although I'm not a big fan of this approach within this particular project (cost/complexity vs. benefit), I wouldn't classify the compile time issue itself as very severe and would generally be tempted to concur with @Geod24. On the other hand, maybe there are a few easy targets within the code to make it compile faster, which could be a worthwhile investment that also benefits the original library. |
Doing any work to fix a problem i had becomes a pain as i now need to wait 10 seconds each time i want to compile my change, it's not sustainable It is this bad even with just one line change, it does bunch of serializing things as well as bunch of deprecating warnings
|
(This is something that needs to be looked into, might be a bug.) |
We should really start looking into using dub to build dub with dependencies, or at least use dub on the bootstrapping system to download dependencies and generating the compile command. It'd also be nice to not need to vendor all the extra dependencies this way and would add some compilation cache for dependencies. We could also make the recipe parsing a separate submodule, which imo makes sense anyway. I'm with ryuukk here that we should be doing something about this. @s-ludwig @Geod24 what are your opinions about using dub dependencies on dub? Other advantages:
|
|
we have comments on PRs now that show a rough build time and executable size, so it's easier to reason about PRs to (significantly) improve on build times now. |
Time it took to compile modules (generateCodeAndWrite from DMD) (in milliseconds):
List of template instantiations (sema3) that took longer than 100ms
SumType adds more than 2 seconds to compile 🤡 |
yeah really need to improve the compiler for that stuff |
@ryuukk : I appreciate you spending the time to look into the issue and to report it. And any PR that provably improve compile speed without hurting code quality / functionality / abstraction is very welcome. On the other hand, I am trying to keep issues focused on actionable items. Keeping compile time low is IMO a continuous process (like keeping code readable / abstraction clear) which is not well captured by an issue. In this case, an actionable item would be something such as "Get dub to compile in less than 5 seconds". However, there isn't much value in such an issue - it is indeed better for the development experience, but it does not accomplish anything for the end user. Hence I am going to close this as WONTFIX - which doesn't mean, as stated above, that improvements are not encouraged. |
You misunderstood the issue, i'm not asking you to get dub to compile to 5s I noticed a severe regression that doubled the time it takes to compile, and i reported it This is a problem that needs everyone attention, you choosing to close this issue and tagging as "wontfix" is concerning, it shows that you absolutely do not care at all |
If the issue is that dub is slower to compile projects, then we should definitely re-open this issue. However I am going off your original post:
The increase in compile time for dub itself is not as worrying as an increase across the board. For reference, I have been working on improving dub compile time across the board, mostly with improvements to the To test if Dub compile time has increased, we need to test the same codebase with the same compiler:
This should be a good baseline, as most of my improvements came in v1.30.0. I'm using DMD v2.106 to compile, got them using the install script. Older dub:
Newer dub:
I also made sure to clean up both caches (
And for newer dub:
As you can see, the best time for the new dub is 300 ms faster than for the old dub. That does not seem to support the claim that dub is slower at compiling projects. Now if we talking dub's own compile time, yes it has gone up:
|
System information
Bug Description
dub compiles in 10 seconds
How to reproduce?
Expected Behavior
Previous version: v1.29.2 compiles in 5 seconds
It now is 2x slower...
D compiles fast, yet all the community projects compiles very slow
EDIT:
to clarify: i am compiling the dub repo with dub that comes with "dmd v2.102.0"
The text was updated successfully, but these errors were encountered: