January 15, 2020 Re: Practical parallelization of D compilation | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinke | Concerning the first (fresh) compilation:
On Wednesday, 8 January 2020 at 13:14:38 UTC, kinke wrote:
> [...] you can also try to compile all modules at once, but output separate object files - `ldc2 -c a.d b.d c.d`.
I just had another try at `ldc2 -c ...`. It does work when grouping the files in chunks of say 50.
So now I could parallelize the first (fresh) compilation using that chunk approach, and this leads to compilation times comparable to, or even faster than the single-process approach `ldmd2 -i main.d`.
real time:
* 4-core: 57 seconds with chunks instead of 52 seconds with the single-process approach
* 8-core: 23 seconds with chunks instead of 33 seconds with the single-process approach
So the drawback of this approach has pretty much disappeared, at least on my 200 files :)
Thanks a lot for all the feedback!
Guillaume
|
Copyright © 1999-2021 by the D Language Foundation