www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Incremental builds?

reply "ProgrammingGhost" <dsioafiseghvfawklncfskzdcf sdifjsdiovgfdisjcisj.com> writes:
I assume D can do incremental builds? How fast is the compile 
time compared to C++? Is it slower? C++ only has to read its 
header files and D would need to look at the entire project 
source code (or obj files?).
Sep 26 2013
next sibling parent "Dicebot" <public dicebot.lv> writes:
On Thursday, 26 September 2013 at 14:02:53 UTC, ProgrammingGhost 
wrote:
 I assume D can do incremental builds? How fast is the compile 
 time compared to C++? Is it slower? C++ only has to read its 
 header files and D would need to look at the entire project 
 source code (or obj files?).

AFAIK, it is slower that compiling all at once but faster than C++ (because C++ compilation is so damn slow on its own). In D world it is most often used to avoid compiler memory limits, though, not for actual speed.
Sep 26 2013
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2013-09-26 16:02, ProgrammingGhost wrote:
 I assume D can do incremental builds? How fast is the compile time
 compared to C++? Is it slower? C++ only has to read its header files and
 D would need to look at the entire project source code (or obj files?).

There are some known problems with incremental builds in D. Something about not all symbols are outputted to all object files. You can search these newsgroups. Tomaz tried quite hard to do proper incremental builds but run into problems. -- /Jacob Carlborg
Sep 26 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-09-26 21:44, Dicebot wrote:

 Some of those has been just recently fixed ;)

Cool, do you have the numbers for the bugzilla issues? -- /Jacob Carlborg
Sep 26 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-09-27 00:57, Martin Nowak wrote:

 http://d.puremagic.com/issues/show_bug.cgi?id=9571
 https://github.com/D-Programming-Language/dmd/pull/2550
 https://github.com/D-Programming-Language/dmd/pull/2566

I'm not sure if that's the same issue. The issue I'm thinking about was reported several years ago. Although, I don't know if it ended up in bugzilla. There's the original post: http://forum.dlang.org/thread/h8ddc5$1h67$1 digitalmars.com#post-h8ddc5:241h67:241:40digitalmars.com Here's an issue report from xfbuild that contains some useful links: https://bitbucket.org/h3r3tic/xfbuild/issue/7/make-incremental-building-reliable -- /Jacob Carlborg
Sep 26 2013
prev sibling next sibling parent "Dicebot" <public dicebot.lv> writes:
On Thursday, 26 September 2013 at 19:31:06 UTC, Jacob Carlborg 
wrote:
 On 2013-09-26 16:02, ProgrammingGhost wrote:
 I assume D can do incremental builds? How fast is the compile 
 time
 compared to C++? Is it slower? C++ only has to read its header 
 files and
 D would need to look at the entire project source code (or obj 
 files?).

There are some known problems with incremental builds in D. Something about not all symbols are outputted to all object files. You can search these newsgroups. Tomaz tried quite hard to do proper incremental builds but run into problems.

Some of those has been just recently fixed ;)
Sep 26 2013
prev sibling next sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Thursday, 26 September 2013 at 14:02:53 UTC, ProgrammingGhost 
wrote:
 I assume D can do incremental builds? How fast is the compile 
 time compared to C++? Is it slower? C++ only has to read its 
 header files and D would need to look at the entire project 
 source code (or obj files?).

dmd compile times are very fast compared to c++ compilers.
Sep 26 2013
parent Jacob Carlborg <doob me.com> writes:
On 2013-09-27 01:47, Jonathan M Davis wrote:

 Fast enough that you'd have to have a very large project for incremental
 builds to gain you anything. Maybe you could gain time if the incremental
 builds were done in parallel, but even then, the build time is going to be
 dwarfed by the link time in a lot of programs. Most projects aren't going to
 be big enough to really gain much from incremental builds. I'd only worry
 about that if I were doing a large application and building it was
 demonstratively slow.

I don't know how others think about incremental compilation. But I'm don't think about compiling each file separately. I'm thinking about compiling only what's changed and compile all those files in one go. That would mean the first time you compile a project it would compile all files at once, just as most people do today. Then when some files are changed it will only compile those, in one go. This should at least in theory speed up the compilation. But perhaps most projects are too small to actually make a difference in practice. -- /Jacob Carlborg
Sep 26 2013
prev sibling next sibling parent "Martin Nowak" <code dawg.eu> writes:
On Thursday, 26 September 2013 at 20:12:38 UTC, Jacob Carlborg 
wrote:
 On 2013-09-26 21:44, Dicebot wrote:

 Some of those has been just recently fixed ;)

Cool, do you have the numbers for the bugzilla issues?

http://d.puremagic.com/issues/show_bug.cgi?id=9571 https://github.com/D-Programming-Language/dmd/pull/2550 https://github.com/D-Programming-Language/dmd/pull/2566
Sep 26 2013
prev sibling next sibling parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Thursday, September 26, 2013 23:29:56 John Colvin wrote:
 On Thursday, 26 September 2013 at 14:02:53 UTC, ProgrammingGhost
 
 wrote:
 I assume D can do incremental builds? How fast is the compile
 time compared to C++? Is it slower? C++ only has to read its
 header files and D would need to look at the entire project
 source code (or obj files?).

dmd compile times are very fast compared to c++ compilers.

Fast enough that you'd have to have a very large project for incremental builds to gain you anything. Maybe you could gain time if the incremental builds were done in parallel, but even then, the build time is going to be dwarfed by the link time in a lot of programs. Most projects aren't going to be big enough to really gain much from incremental builds. I'd only worry about that if I were doing a large application and building it was demonstratively slow. - Jonathan M Davis
Sep 26 2013
prev sibling next sibling parent "Peter Alexander" <peter.alexander.au gmail.com> writes:
On Thursday, 26 September 2013 at 23:47:34 UTC, Jonathan M Davis 
wrote:
 On Thursday, September 26, 2013 23:29:56 John Colvin wrote:
 On Thursday, 26 September 2013 at 14:02:53 UTC, 
 ProgrammingGhost
 
 wrote:
 I assume D can do incremental builds? How fast is the compile
 time compared to C++? Is it slower? C++ only has to read its
 header files and D would need to look at the entire project
 source code (or obj files?).

dmd compile times are very fast compared to c++ compilers.

Fast enough that you'd have to have a very large project for incremental builds to gain you anything. Maybe you could gain time if the incremental builds were done in parallel, but even then, the build time is going to be dwarfed by the link time in a lot of programs. Most projects aren't going to be big enough to really gain much from incremental builds. I'd only worry about that if I were doing a large application and building it was demonstratively slow. - Jonathan M Davis

Unless you are doing optimised builds, which are still painfully slow.
Sep 27 2013
prev sibling next sibling parent "Dicebot" <public dicebot.lv> writes:
On Friday, 27 September 2013 at 06:40:22 UTC, Jacob Carlborg 
wrote:
 I don't know how others think about incremental compilation. 
 But I'm don't think about compiling each file separately. I'm 
 thinking about compiling only what's changed and compile all 
 those files in one go.

 That would mean the first time you compile a project it would 
 compile all files at once, just as most people do today. Then 
 when some files are changed it will only compile those, in one 
 go.

 This should at least in theory speed up the compilation. But 
 perhaps most projects are too small to actually make a 
 difference in practice.

With recent change of verbose dmd output for template dependencies it should kind of work (worked for me in simple tests). Problem is that it does not work when all changed dependencies are compiled at once, only one by one - thus it is not worth it until really big projects.
Sep 27 2013
prev sibling next sibling parent "PauloPinto" <pjmlp progtools.org> writes:
On Friday, 27 September 2013 at 06:40:22 UTC, Jacob Carlborg 
wrote:
 On 2013-09-27 01:47, Jonathan M Davis wrote:

 Fast enough that you'd have to have a very large project for 
 incremental
 builds to gain you anything. Maybe you could gain time if the 
 incremental
 builds were done in parallel, but even then, the build time is 
 going to be
 dwarfed by the link time in a lot of programs. Most projects 
 aren't going to
 be big enough to really gain much from incremental builds. I'd 
 only worry
 about that if I were doing a large application and building it 
 was
 demonstratively slow.

I don't know how others think about incremental compilation. But I'm don't think about compiling each file separately. I'm thinking about compiling only what's changed and compile all those files in one go. That would mean the first time you compile a project it would compile all files at once, just as most people do today. Then when some files are changed it will only compile those, in one go. This should at least in theory speed up the compilation. But perhaps most projects are too small to actually make a difference in practice.

From my enterprise seat, I tend to favor compilation against binary modules. It is not as if you have always source code available and D has modules, so I expect eventually to make use of binary modules like in most languages that have module support. -- Paulo
Sep 27 2013
prev sibling next sibling parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Friday, 27 September 2013 at 07:12:50 UTC, Peter Alexander 
wrote:
 On Thursday, 26 September 2013 at 23:47:34 UTC, Jonathan M 
 Davis wrote:
 On Thursday, September 26, 2013 23:29:56 John Colvin wrote:
 On Thursday, 26 September 2013 at 14:02:53 UTC, 
 ProgrammingGhost
 
 wrote:
 I assume D can do incremental builds? How fast is the 
 compile
 time compared to C++? Is it slower? C++ only has to read its
 header files and D would need to look at the entire project
 source code (or obj files?).

dmd compile times are very fast compared to c++ compilers.

Fast enough that you'd have to have a very large project for incremental builds to gain you anything. Maybe you could gain time if the incremental builds were done in parallel, but even then, the build time is going to be dwarfed by the link time in a lot of programs. Most projects aren't going to be big enough to really gain much from incremental builds. I'd only worry about that if I were doing a large application and building it was demonstratively slow. - Jonathan M Davis

Unless you are doing optimised builds, which are still painfully slow.

In my experience, they are still faster than I was used to in c++
Sep 27 2013
prev sibling parent "PauloPinto" <pjmlp progtools.org> writes:
On Friday, 27 September 2013 at 10:01:13 UTC, John Colvin wrote:
 On Friday, 27 September 2013 at 07:12:50 UTC, Peter Alexander 
 wrote:
 On Thursday, 26 September 2013 at 23:47:34 UTC, Jonathan M 
 Davis wrote:
 On Thursday, September 26, 2013 23:29:56 John Colvin wrote:
 On Thursday, 26 September 2013 at 14:02:53 UTC, 
 ProgrammingGhost
 
 wrote:
 I assume D can do incremental builds? How fast is the 
 compile
 time compared to C++? Is it slower? C++ only has to read 
 its
 header files and D would need to look at the entire project
 source code (or obj files?).

dmd compile times are very fast compared to c++ compilers.

Fast enough that you'd have to have a very large project for incremental builds to gain you anything. Maybe you could gain time if the incremental builds were done in parallel, but even then, the build time is going to be dwarfed by the link time in a lot of programs. Most projects aren't going to be big enough to really gain much from incremental builds. I'd only worry about that if I were doing a large application and building it was demonstratively slow. - Jonathan M Davis

Unless you are doing optimised builds, which are still painfully slow.

In my experience, they are still faster than I was used to in c++

Any language with proper modules should be faster than C and C++.
Sep 27 2013