Jump to page: 1 2
Thread overview
Building is slow!
Dec 02
rjframe
Dec 02
tetyys
Dec 02
Arek
Dec 05
Arek
Dec 03
Arek
Dec 02
Indigo
December 02
When DUB bulds the gtk-d library, it takes a long time. This is mostly because it's only using one processor. It hasn't been such a big deal on Linux but I'm building my app on Windows right now and it been building gtk-d for the last half hour! Is there any way to make DUB use more processors?
December 02
On Sat, 02 Dec 2017 00:24:12 +0000, Ivan Trombley wrote:

> When DUB bulds the gtk-d library, it takes a long time. This is mostly because it's only using one processor. It hasn't been such a big deal on Linux but I'm building my app on Windows right now and it been building gtk-d for the last half hour! Is there any way to make DUB use more processors?

There is a --parallel flag: `dub build --parallel`.

The help string says it "Runs multiple compiler instances in parallel, if possible."
December 02
On Saturday, 2 December 2017 at 03:08:10 UTC, rjframe wrote:
> There is a --parallel flag: `dub build --parallel`.
>
> The help string says it "Runs multiple compiler instances in parallel, if possible."

Thanks, I'll give that a try. After an hour, I pressed CTRL+C, shut it down and went home.
December 02
Something must be definitely wrong if compilation takes half an hour, unless you're trying to compile it on a toaster. An infinite loop?
December 02
On Saturday, 2 December 2017 at 09:50:32 UTC, Ivan Trombley wrote:
> On Saturday, 2 December 2017 at 03:08:10 UTC, rjframe wrote:
>> There is a --parallel flag: `dub build --parallel`.
>>
>> The help string says it "Runs multiple compiler instances in parallel, if possible."
>
> Thanks, I'll give that a try. After an hour, I pressed CTRL+C, shut it down and went home.

By default, when you run `dub build` building is done in mode 'separate', what means all source files are compiled at once in one dmd instance.

In case of big project it can consume a lot of memory and sometimes swaps intensively.
Also "--parallel" doesn't change anything, because there is only one process of the compiler so it runs on one core only.

You can try `dub build --build-mode=single-file --parallel`. It will execute separate instance of compiler for each source file. If --parallel is given, dub will launch several instances of dmd in parallel.


December 02
On Saturday, 2 December 2017 at 00:24:12 UTC, Ivan Trombley wrote:
> When DUB bulds the gtk-d library, it takes a long time. This is mostly because it's only using one processor. It hasn't been such a big deal on Linux but I'm building my app on Windows right now and it been building gtk-d for the last half hour! Is there any way to make DUB use more processors?

I haven't tried gtkd in a while but when I did it built in seconds... I was not using dub though but the build script that comes with it.
December 02
On Saturday, 2 December 2017 at 14:34:58 UTC, Arek wrote:
> You can try `dub build --build-mode=single-file --parallel`. It will execute separate instance of compiler for each source file. If --parallel is given, dub will launch several instances of dmd in parallel.

I get the error:
  Error processing arguments: BuildMode does not have a member named 'single-file'


On Saturday, 2 December 2017 at 22:54:56 UTC, Indigo wrote:
> I haven't tried gtkd in a while but when I did it built in seconds... I was not using dub though but the build script that comes with it.

My project has
  "dependencies": {
    "gtk-d": "3.7.2"
  }

To build release, it takes more than three minutes to build gtk-d on Linux (Ryzen 7 1700 processor).

December 03
On Saturday, 2 December 2017 at 23:26:20 UTC, Ivan Trombley wrote:
> On Saturday, 2 December 2017 at 14:34:58 UTC, Arek wrote:
>> You can try `dub build --build-mode=single-file --parallel`. It will execute separate instance of compiler for each source file. If --parallel is given, dub will launch several instances of dmd in parallel.
>
> I get the error:
>   Error processing arguments: BuildMode does not have a member named 'single-file'

--build-mode=singleFile seems to work. This shaved off 1/3 of the time to compile gtk-d in release mode on Linux, so I'm going to give this a try on Windows.
December 03
On Saturday, 2 December 2017 at 23:26:20 UTC, Ivan Trombley wrote:
> On Saturday, 2 December 2017 at 14:34:58 UTC, Arek wrote:
>> You can try `dub build --build-mode=single-file --parallel`. It will execute separate instance of compiler for each source file. If --parallel is given, dub will launch several instances of dmd in parallel.
>
> I get the error:
>   Error processing arguments: BuildMode does not have a member named 'single-file'
>

Sorry, my mistake. `--build-mode=singleFile`

>
> On Saturday, 2 December 2017 at 22:54:56 UTC, Indigo wrote:
>> I haven't tried gtkd in a while but when I did it built in seconds... I was not using dub though but the build script that comes with it.
>
> My project has
>   "dependencies": {
>     "gtk-d": "3.7.2"
>   }
>
> To build release, it takes more than three minutes to build gtk-d on Linux (Ryzen 7 1700 processor).

The only reason for really long builds I know, was a lack of memory and swapping.

December 05
There are issues with using "--build-mode=singleFile --parallel". On Windows I get errors saying that it can't write out some intermediate files (it looks like the file names may be too long for Windows) and on Linux, it makes the executable at least 3 MB larger in release mode. Also, it doesn't always seem to make building faster. On a 2 core i7 machine, it actually takes nearly twice as long to build.
« First   ‹ Prev
1 2