Skip to content
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

Closed
ryuukk opened this issue Feb 17, 2023 · 13 comments
Closed

dub now takes 2x longer to compile #2600

ryuukk opened this issue Feb 17, 2023 · 13 comments
Labels

Comments

@ryuukk
Copy link
Contributor

ryuukk commented Feb 17, 2023

System information

  • dub version: ~master
  • OS Platform and distribution: Windows 10 x64
  • compiler version: dmd v2.102.0 (DUB version 1.31.0, built on Feb 1 2023)

Bug Description

dub compiles in 10 seconds

How to reproduce?

time dub build -f

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"

@Geod24
Copy link
Member

Geod24 commented Feb 17, 2023

Timing a from-scratch build is not really a fair assessment. Absolute compile time is not as important as incremental one.
Also, the reason why dub is much slower to compile is, I believe, that there is much more code now in the project (D-YAML, Configy) and much more templates. I'm tempted to close this as WONTFIX, @WebFreak001 ?

@ryuukk
Copy link
Contributor Author

ryuukk commented Feb 17, 2023

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

@s-ludwig
Copy link
Member

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. dmd -vtemplates might provide a good starting point here.

@ryuukk
Copy link
Contributor Author

ryuukk commented Feb 19, 2023

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

$ time dub build
    Starting Performing "debug" build using C:\D\dmd2\windows\bin\dmd.exe for x86_64.
    Building dub 1.31.1+commit.26.g9b15ad07: building configuration [application]
source\dub\internal\dyaml\node.d(2513,9): Deprecation: scope variable `this` assigned to non-scope parameter `_param_0` calling `match`
Serializing composite type Flags!(BuildRequirement) which has no serializable fields
Serializing composite type Flags!(BuildOption) which has no serializable fields
source\dub\dependency.d(917,18): Deprecation: scope variable `this` assigned to non-scope parameter `oth` calling `opEquals`
source\dub\dependency.d(920,30): Deprecation: scope variable `this` assigned to non-scope parameter `a` calling `doCmp`
source\dub\dependency.d(921,27): Deprecation: scope variable `this` assigned to non-scope parameter `b` calling `doCmp`
source\dub\dependency.d(939,26): Deprecation: scope variable `this` assigned to non-scope parameter `oth` calling `opEquals`
source\dub\internal\configy\Exceptions.d(130,34): Deprecation: reference to local variable `buffer` assigned to non-scope anonymous parameter
source\dub\internal\configy\Exceptions.d(134,34): Deprecation: reference to local variable `buffer` assigned to non-scope anonymous parameter
source\dub\internal\configy\Exceptions.d(248,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(250,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(283,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(286,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(323,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(325,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(332,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
source\dub\internal\configy\Exceptions.d(335,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\write.d(537,34):        which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        which would be `@system` because of:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\format\spec.d(258,33):        scope variable `this` assigned to non-scope parameter `e` calling `put`
     Linking dub

real    0m12.046s
user    0m0.000s
sys     0m0.015s

@s-ludwig
Copy link
Member

Serializing composite type Flags!(BuildRequirement) which has no serializable fields

(This is something that needs to be looked into, might be a bug.)

@WebFreak001
Copy link
Member

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. dmd -vtemplates might provide a good starting point here.

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:

  • the mental threshold to add new dependencies for cool features lowers, making it more likely that users would just try out dependencies for features
  • no need to double maintain bug fixes and improvements

@Geod24
Copy link
Member

Geod24 commented Feb 20, 2023

what are your opinions about using dub dependencies on dub?

#1972

@WebFreak001
Copy link
Member

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.

@ryuukk
Copy link
Contributor Author

ryuukk commented Sep 23, 2023

Time it took to compile modules (generateCodeAndWrite from DMD) (in milliseconds):

691.884900 :: buildsettings
461.375900 :: Read
102.835300 :: project
79.570500 :: stdsumtype
75.414400 :: app
75.130500 :: constructor
37.740900 :: commandline
33.642200 :: logging
30.456000 :: dub
29.800600 :: json
29.321400 :: utils
24.853000 :: packagerecipe
24.186000 :: xml
23.853200 :: generator
23.766100 :: packagemanager
22.617300 :: sdl
20.504200 :: node
19.638100 :: file
18.614100 :: utils
18.525700 :: queue
16.508000 :: ast
15.971100 :: build
15.061700 :: lexer
13.889900 :: package_
12.739200 :: serialization
11.905100 :: dmd
11.529400 :: dependencyresolver
11.352300 :: scanner
10.507000 :: ldc
10.076300 :: visuald
9.766000 :: json
9.681300 :: dependency
9.243400 :: gdc
7.252400 :: cwrite
6.371300 :: composer
6.048500 :: reader
5.974100 :: parser
5.826600 :: Exceptions
5.345100 :: token
4.581400 :: parser
4.381900 :: url
4.208200 :: path
3.755600 :: Utils
3.447800 :: description
3.177700 :: registry
2.886100 :: FieldRef
2.748400 :: sublimetext
2.695100 :: filesystem
2.635000 :: cmake
2.564500 :: semver
2.513000 :: representer
2.297200 :: maven
1.932100 :: compiler
1.898500 :: loader
1.666300 :: Attributes
1.639400 :: fallback
1.548700 :: event
1.470900 :: targetdescription
1.446900 :: git
1.430300 :: selection
1.362800 :: resolver
1.249200 :: io
1.204400 :: init
1.184000 :: token
1.152800 :: exception
1.130200 :: platform
1.021100 :: util
0.971900 :: dumper
0.936900 :: serializer
0.933800 :: settings
0.862100 :: packagesupplier
0.780600 :: winterm
0.752900 :: libInputVisitor
0.679500 :: tinyendian
0.603900 :: utils
0.594700 :: exception
0.498200 :: symbol
0.356600 :: temp_files
0.271100 :: colors
0.246400 :: tagdirective
0.208600 :: emitter
0.161600 :: escapes
0.085100 :: linebreak
0.057600 :: style
0.051400 :: Test
0.050100 :: sdlang
0.049800 :: dyaml
0.045400 :: packagesupplier
0.033900 :: colorize
0.021300 :: DubTest
0.019400 :: version_
0.018500 :: packagesuppliers
0.016800 :: encoding

List of template instantiations (sema3) that took longer than 100ms

117.946400 :: matchImpl :: matchImpl!(const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])), const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])))
118.172700 :: match :: match!(const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])), const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])))
118.411200 :: __anonymous :: opEquals!(const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])), const(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])))
125.846800 :: SumType :: SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[])
110.037800 :: matchImpl :: matchImpl!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
110.295800 :: match :: match!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
110.496400 :: opEquals :: opEquals!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
109.029200 :: matchImpl :: matchImpl!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
109.245600 :: match :: match!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
109.388400 :: opEquals :: opEquals!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
109.528500 :: __lambda2 :: __lambda2!(ValueEvent, ValueEvent)
126.919800 :: matchImpl :: matchImpl!(SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent), SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent))
127.094700 :: match :: match!(SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent), SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent))
127.266700 :: opEquals :: opEquals!(SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent), SumType!(FileStartEvent, FileEndEvent, TagStartEvent, TagEndEvent, ValueEvent, AttributeEvent))
114.795600 :: matchImpl :: matchImpl!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
114.979600 :: match :: match!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
115.129500 :: toString :: toString!(SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), S, char)
126.900800 :: formatValue :: formatValue!(Appender!string, SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]), char)
128.686300 :: formattedWrite :: formattedWrite!(Appender!string, char, string, SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
128.962800 :: format :: format!(char, string, SumType!(typeof(null), bool, string, dchar, int, long, float, double, real, Date, DateTimeFrac, SysTime, DateTimeFracUnknownZone, Duration, ubyte[]))
149.895300 :: convert :: convert!(__T8FieldRefTS3dub6recipe13packagerecipe17ConfigurationInfoVAyaa13_6275696c6453657474696e6773Vbi0Z)
158.113000 :: parseMapping :: parseMapping!(__T14StructFieldRefTS3dub6recipe13packagerecipe17ConfigurationInfoVAyanZ)
217.145900 :: parseField :: parseField!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa14_636f6e66696775726174696f6e73Vbi0Z)
218.208800 :: convertField :: convertField!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa14_636f6e66696775726174696f6e73Vbi0Z)
218.331300 :: convert :: convert!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa14_636f6e66696775726174696f6e73Vbi0Z)
138.378800 :: parseMapping :: parseMapping!(__T14NestedFieldRefTS3dub6recipe13packagerecipe21BuildSettingsTemplateSQBy8internal7configy8FieldRef__TQmTSQDiQDhQDd13PackageRecipeVAyaa10_6275696c645479706573Vbi0ZZ)
138.746400 :: parseField :: parseField!(__T14NestedFieldRefTS3dub6recipe13packagerecipe21BuildSettingsTemplateSQBy8internal7configy8FieldRef__TQmTSQDiQDhQDd13PackageRecipeVAyaa10_6275696c645479706573Vbi0ZZ)
141.733100 :: parseField :: parseField!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa10_6275696c645479706573Vbi0Z)
142.748700 :: convertField :: convertField!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa10_6275696c645479706573Vbi0Z)
142.874900 :: convert :: convert!(__T8FieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyaa10_6275696c645479706573Vbi0Z)
457.409800 :: parseMapping :: parseMapping!(__T14StructFieldRefTS3dub6recipe13packagerecipe13PackageRecipeVAyanZ)
459.021200 :: parseConfig :: parseConfig!(PackageRecipe)
459.149200 :: parseConfigString :: parseConfigString!(PackageRecipe)

SumType adds more than 2 seconds to compile 🤡

@WebFreak001
Copy link
Member

yeah really need to improve the compiler for that stuff

@Geod24
Copy link
Member

Geod24 commented Dec 28, 2023

@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.

@Geod24 Geod24 closed this as completed Dec 28, 2023
@Geod24 Geod24 added the wontfix label Dec 28, 2023
@ryuukk
Copy link
Contributor Author

ryuukk commented Dec 29, 2023

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

@Geod24
Copy link
Member

Geod24 commented Dec 29, 2023

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:

to clarify: i am compiling the dub repo with dub that comes with "dmd v2.102.0"

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 PackageManager (See #2338) and the central build cache. And when I introduced the new config reading framework, I timed it, and while it did have an impact, the impact wasn't that much.

To test if Dub compile time has increased, we need to test the same codebase with the same compiler:

% ~/dlang/dmd-2.100.0/linux/bin64/dub --version
DUB version 1.29.0, built on May 13 2022
% ~/dlang/dmd-2.106.0/linux/bin64/dub --version
DUB version 1.35.0, built on Dec  2 2023

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:

% time ~/dlang/dmd-2.100.0/linux/bin64/dub build --compiler=$HOME/dlang/dmd-2.106.0/linux/bin64/dmd
Performing "debug" build using /home/mlang/dlang/dmd-2.106.0/linux/bin64/dmd for x86_64.
dub 1.35.0-rc.1+commit.44.g56077da3: building configuration "application"...
[...]
Linking...
~/dlang/dmd-2.100.0/linux/bin64/dub build   4.84s user 1.14s system 95% cpu 6.266 total

Newer dub:

% time ~/dlang/dmd-2.106.0/linux/bin64/dub build --compiler=$HOME/dlang/dmd-2.106.0/linux/bin64/dmd
    Starting Performing "debug" build using /home/mlang/dlang/dmd-2.106.0/linux/bin64/dmd for x86_64.
    Building dub 1.35.0-rc.1+commit.44.g56077da3: building configuration [application]
[...]
     Linking dub
~/dlang/dmd-2.106.0/linux/bin64/dub build   4.94s user 1.23s system 98% cpu 6.264 total

I also made sure to clean up both caches (.dub for the old version, ~/.dub/cache/dub/* for the new version).
Obviously you should measure more than once, so for older dub:

% time ~/dlang/dmd-2.100.0/linux/bin64/dub build --compiler=$HOME/dlang/dmd-2.106.0/linux/bin64/dmd && rm -rf .dub
~/dlang/dmd-2.100.0/linux/bin64/dub build   5.40s user 1.04s system 98% cpu 6.510 total
~/dlang/dmd-2.100.0/linux/bin64/dub build   5.28s user 1.29s system 99% cpu 6.613 total
~/dlang/dmd-2.100.0/linux/bin64/dub build   5.37s user 1.22s system 98% cpu 6.671 total
~/dlang/dmd-2.100.0/linux/bin64/dub build   5.11s user 1.00s system 98% cpu 6.191 total

And for newer dub:

% time ~/dlang/dmd-2.106.0/linux/bin64/dub build --compiler=$HOME/dlang/dmd-2.106.0/linux/bin64/dmd && rm -rf ~/.dub/cache/dub/
~/dlang/dmd-2.106.0/linux/bin64/dub build   5.34s user 1.44s system 99% cpu 6.834 total
~/dlang/dmd-2.106.0/linux/bin64/dub build   4.66s user 1.10s system 98% cpu 5.840 total
~/dlang/dmd-2.106.0/linux/bin64/dub build   4.89s user 1.28s system 98% cpu 6.270 total
~/dlang/dmd-2.106.0/linux/bin64/dub build   5.22s user 1.09s system 98% cpu 6.381 total

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:

% time ~/dlang/dmd-2.106.0/linux/bin64/dub build --compiler=$HOME/dlang/dmd-2.106.0/linux/bin64/dmd && rm -rf ~/.dub/cache/dub/
    Starting Performing "debug" build using /home/mlang/dlang/dmd-2.106.0/linux/bin64/dmd for x86_64.
    Building dub 1.29.0: building configuration [application]
Serializing composite type BuildRequirements which has no serializable fields
Serializing composite type BuildOptions which has no serializable fields
     Linking dub
~/dlang/dmd-2.106.0/linux/bin64/dub build   2.86s user 0.65s system 97% cpu 3.597 total
 % git describe
v1.29.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants