Am 16.04.2014 23:16, schrieb Orfeo:

I have to build and test a project with this dependencies

...
"dependencies": {
       "gtk-d:gtkd": "~master",
       "dunit": ">=1.0.9",
       "dejector": "~master"
}

These are the results on my (old and slow) PC:

|           | 1st | 2nd   | test |
| --------- |-----| ----- | ---- |
|dub        | 38s | 14s   | 45s  |
|dub --rdmd |  8s |  6s   | -    |
|make       |  3s |  0s   | 9s   |

1st indicates first build time (ie 'time dub build'), 2nd indicates second build without changing anything, and finally test indicates test time (ie 'time dub test')

As you can see test takes 45s ... so I'm therefore obliged to use make.

Is there a way to improve dub performance?

Which version of DUB are you using? There have been some changes that
may affect performance recently.

It would be interesting to see where exactly the time is spent during
the build. Can you try to roughly estimate from the console output how
much time is spent for the actual compilation, how much for
initialization and how much for linking?

If compilation takes considerably longer than for --rdmd, that would
indicate that only a very small part of the code is actually used and
RDMD skips most files when passing them to DMD. But more importantly,
using --rdmd compiles the whole project at once instead of building
separate static libraries for the dependencies. You could also try to
use --combined and see how it compares, it should especially improve the
first run.

But 14 s for the second run indicates that there is considerable time
spend either during initialization, or while checking for changes. I
think I'll implement a little time summary for dub -v so that a better
analysis is possible.