www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Some discussion on dub dependency resolution

reply Hipreme <msnmancini hotmail.com> writes:
Recently, I've added some default timers to my build system, and 
I've noticed something quite interesting:

```
G:\HipremeEngine\tools\user\build_selector\D\ldc2-1.33.0-beta1-win
ows-x64\bin\dub.exe build --parallel --compiler=dmd -c script
      Warning

      Warning
      Warning The following compiler flags have been specified in 
the package description
      Warning file. They are handled by DUB and direct use in 
packages is discouraged.
      Warning Alternatively, you can set the DFLAGS environment 
variable to pass custom flags
      Warning to the compiler, or use one of the suggestions below:
      Warning
      Warning debugMode: Call DUB with --build=debug
      Warning debugInfo: Call DUB with --build=debug
      Warning warnings: Use "buildRequirements" to control the 
warning level
      Warning
     Starting Performing "debug" build using dmd for x86_64.
   Up-to-date audio-formats 2.1.2: target for configuration 
[boost] is up to date.
   Up-to-date util ~master: target for configuration [library] is 
up to date.
   Up-to-date hipengine_api ~master: target for configuration 
[hipengine] is up to date.
   Up-to-date audio_decoding ~master: target for configuration 
[audioformats] is up to date.
   Up-to-date bindbc-loader 1.0.3: target for configuration [noBC] 
is up to date.
   Up-to-date bindbc-openal 1.0.1: target for configuration 
[dynamic] is up to date.
   Up-to-date directx-d ~master: target for configuration 
[library] is up to date.
   Up-to-date config ~master: target for configuration [default] 
is up to date.
   Up-to-date debugging ~master: target for configuration 
[default] is up to date.
   Up-to-date console ~master: target for configuration [default] 
is up to date.
   Up-to-date error ~master: target for configuration [default] is 
up to date.
   Up-to-date math ~master: target for configuration [default] is 
up to date.
   Up-to-date audio ~master: target for configuration [default] is 
up to date.
   Up-to-date data ~master: target for configuration [default] is 
up to date.
   Up-to-date bind ~master: target for configuration [default] is 
up to date.
   Up-to-date filesystem ~master: target for configuration 
[default] is up to date.
   Up-to-date arsd-official:ttf 10.9.10: target for configuration 
[library] is up to date.
   Up-to-date arsd-official:color_base 10.9.10: target for 
configuration [library] is up to date.
   Up-to-date arsd-official:bmp 10.9.10: target for configuration 
[library] is up to date.
   Up-to-date arsd-official:imageresize 10.9.10: target for 
configuration [library] is up to date.
   Up-to-date arsd-official:jpeg 10.9.10: target for configuration 
[library] is up to date.
   Up-to-date arsd-official:png 10.9.10: target for configuration 
[library] is up to date.
   Up-to-date arsd-official:svg 10.9.10: target for configuration 
[library] is up to date.
   Up-to-date arsd-official:image_files 10.9.10: target for 
configuration [library] is up to date.
   Up-to-date image ~master: target for configuration [arsd] is up 
to date.
   Up-to-date bindbc-opengl 1.0.5: target for configuration 
[dynamic] is up to date.
   Up-to-date windowing ~master: target for configuration 
[default] is up to date.
   Up-to-date renderer ~master: target for configuration [default] 
is up to date.
   Up-to-date font ~master: target for configuration [default] is 
up to date.
   Up-to-date assets ~master: target for configuration [default] 
is up to date.
   Up-to-date fswatch 0.6.1: target for configuration [library] is 
up to date.
   Up-to-date timer ~master: target for configuration [default] is 
up to date.
   Up-to-date tween ~master: target for configuration [default] is 
up to date.
   Up-to-date hipreme_engine ~feature/build_refactor: target for 
configuration [script] is up to date.
     Finished To force a rebuild of up-to-date targets, run again 
with --force
1890ms
```


As you can see, it prints 1890 milliseconds took (almost 2 
seconds), for detecting that literally every dependency was up to 
date. My project per se, can take up to 6 seconds on a partial 
rebuild, 1/3 of the time simply looking if it is up to date, I 
believe this could be a lot better and would like some feedback 
from people if anyone wanted to tackle on that since dub is 
essential to majority D development.
Sep 19 2023
parent reply "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
Repeat this test with networking disabled, I expect it'll be fast then.

``--skip-registry=all``
Sep 19 2023
parent reply Hipreme <msnmancini hotmail.com> writes:
On Wednesday, 20 September 2023 at 04:11:00 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
 Repeat this test with networking disabled, I expect it'll be 
 fast then.

 ``--skip-registry=all``
``` G:\HipremeEngine\tools\user\build_selector\D\ldc2-1.33.0-beta1-win ows-x64\bin\dub.exe build --parallel --compiler=dmd -c script --skip-registry=all Warning Warning Warning The following compiler flags have been specified in the package description Warning file. They are handled by DUB and direct use in packages is discouraged. Warning Alternatively, you can set the DFLAGS environment variable to pass custom flags Warning to the compiler, or use one of the suggestions below: Warning Warning debugMode: Call DUB with --build=debug Warning debugInfo: Call DUB with --build=debug Warning warnings: Use "buildRequirements" to control the warning level Warning Starting Performing "debug" build using dmd for x86_64. Up-to-date audio-formats 2.1.2: target for configuration [boost] is up to date. Up-to-date util ~master: target for configuration [library] is up to date. Up-to-date hipengine_api ~master: target for configuration [hipengine] is up to date. Up-to-date audio_decoding ~master: target for configuration [audioformats] is up to date. Up-to-date bindbc-loader 1.0.3: target for configuration [noBC] is up to date. Up-to-date bindbc-openal 1.0.1: target for configuration [dynamic] is up to date. Up-to-date directx-d ~master: target for configuration [library] is up to date. Up-to-date config ~master: target for configuration [default] is up to date. Up-to-date debugging ~master: target for configuration [default] is up to date. Up-to-date console ~master: target for configuration [default] is up to date. Up-to-date error ~master: target for configuration [default] is up to date. Up-to-date math ~master: target for configuration [default] is up to date. Up-to-date audio ~master: target for configuration [default] is up to date. Up-to-date data ~master: target for configuration [default] is up to date. Up-to-date bind ~master: target for configuration [default] is up to date. Up-to-date filesystem ~master: target for configuration [default] is up to date. Up-to-date arsd-official:ttf 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:color_base 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:bmp 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:imageresize 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:jpeg 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:png 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:svg 10.9.10: target for configuration [library] is up to date. Up-to-date arsd-official:image_files 10.9.10: target for configuration [library] is up to date. Up-to-date image ~master: target for configuration [arsd] is up to date. Up-to-date bindbc-opengl 1.0.5: target for configuration [dynamic] is up to date. Up-to-date windowing ~master: target for configuration [default] is up to date. Up-to-date renderer ~master: target for configuration [default] is up to date. Up-to-date font ~master: target for configuration [default] is up to date. Up-to-date assets ~master: target for configuration [default] is up to date. Up-to-date fswatch 0.6.1: target for configuration [library] is up to date. Up-to-date timer ~master: target for configuration [default] is up to date. Up-to-date tween ~master: target for configuration [default] is up to date. Up-to-date hipreme_engine ~feature/build_refactor: target for configuration [script] is up to date. Finished To force a rebuild of up-to-date targets, run again with --force 1902ms ``` As you can see, it even took more time :) The network can't be a bottleneck in my project, since most of my dependencies are path based rather than network oriented. I'm sure dub is doing something dumb
Sep 20 2023
parent "Richard (Rikki) Andrew Cattermole" <richard cattermole.co.nz> writes:
Oh yeah that is wayyy too slow, it needs profiling.
Sep 20 2023