Speed up `dub`.

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 14 23:49:00 PDT 2016


On Sat, 2016-05-14 at 16:36 +0000, ciechowoj via Digitalmars-d-learn
wrote:
> On Monday, 7 March 2016 at 21:56:11 UTC, Seb wrote:
> > 
> > Use ld.gold - it will speed up your linking quite dramatically!
> > 
> > https://code.dawg.eu/reducing-vibed-turnaround-time-part-1-faster-l
> > inking.html
> Thanks, it improves things a little. However I've just had idea 
> that it should be possible to implement 'speculative dependency 
> checking' for dub. What I mean by that is to start build process 
> and dependency checking in parallel and then if something changes 
> (with dependencies), apply the changes and restart the build 
> process, and if dependencies are OK continue.

Anecdotal evidence from SCons, Gant, Gradle, Rant, and indeed Make,
seems to indicate that full dependency resolution in the ADG of the
build is the right thing to do for consistent and repeatable builds. 

Various debates have been had in the SCons and Gradle communities over
the years about slow builds, and always, in the end, dependency
resolution up front has always won out.

Interestingly though "dependency resolution" actually has slightly
different meanings in different contexts. In the SCons context it is
about ensuring the ADG of the source → object → executable|library and
the presence of any referenced libraries. In the Ant/Maven/Gant/Gradle
context is is about downloading references libraries and ensuring the
ADG of build tasks is right.

In all cases building the ADG and constructing the resolution list is
not the big problem except in very, very large builds. For example folk
at Intel created Parts as a layer over SCons so as to parallelize and
create partial caches for the build, a bit along the lines of Vesta but
far better.

I cannot be certain, but I am not sure there are any D codebases quite
the same size as the Intel C++ ones.
 
With SCons and Gradle there were various algorithmic and implementation
speedups to ameliorate things and that has helped a lot. I wonder if
there are opportunities to do the same for Dub.  There are many
functionality things that need to be added to Dub to get it into the
Cargo and Gradle end of functionality mayhap performance can be
improved along the way.

I am not sure about DStep build, but for the two projects I have (using
GtkD) build times using Dub were sufficiently long that I switched to
SCons and it is OK and allows for a reasonable development rhythm.
 
-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20160515/a492e7e2/attachment.sig>


More information about the Digitalmars-d-learn mailing list