Help improving dub
Hipreme
msnmancini at hotmail.com
Thu Sep 28 13:49:00 UTC 2023
Hello guys. I have been recently looking into ways for improving
dub and I've find something which could make it get a lot faster
for building the projects and the idea is fairly simple: It is
possible to parallelize its dependencies build commands almost
completely. No need to wait for the requirements to finish first.
All this process could be done in a single go, concurrently, and
the only time it need to wait for the other to finish is in the
link process.
So instead of doing:
A->[B -> C] -> [D -> E] -> Link
We could basically do
[A, B, C, D, E] -> Link
The reason for that is: for building the libraries all the import
paths are basically reparsed anyway, so they don't actually
depend on each other, the requirements could be solved upfront by
simply saving the version statements in each build.
I would like to get this stuff working ASAP, here is the issue
for that: https://github.com/dlang/dub/issues/2702
I started working on that but unfortunately my time is really
short so any help is appreciated.
The main problem right now is basically making dub less statefull
(a little hard since it uses classes and intermediate state
everywhere). The thing is that I know this isn't too hard to make
it happen.
If someone is worried about the pre/postBuildCommands, we could
just get this stuff done firstly and use the existing --parallel
build flag which only works together with the --single flag and
then it could be fixed later since this has a massive improvement
potential with almost no work.
More information about the Digitalmars-d
mailing list