www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - compile time variations

reply Manfred Nowak <svv1999 hotmail.com> writes:
I am experimenting with implementations for AA's and found that the 
times for the compilation with DMD 0.140, 0.141 are strongly 
influenced by the values of some integer constants I use in the 
definitions of my data structures.

Depending on that values the compile times vary from some seconds to 
100 minutes.

I do not use templates. Therefore I am somewhat surprised.

Somebody has a clue?

-manfred
Dec 07 2005
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Manfred Nowak" <svv1999 hotmail.com> wrote in message 
news:Xns9725CE161D105svv1999hotmailcom 63.105.9.61...
I am experimenting with implementations for AA's and found that the
 times for the compilation with DMD 0.140, 0.141 are strongly
 influenced by the values of some integer constants I use in the
 definitions of my data structures.

 Depending on that values the compile times vary from some seconds to
 100 minutes.

 I do not use templates. Therefore I am somewhat surprised.

 Somebody has a clue?

Well, I don't think I've ever heard of this, and I certainly have never run into it, and I've no idea where to even start trying to reproduce it, so I don't think many people will be able to help you unless you provide some code.
Dec 07 2005
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
Jarrett Billingsley wrote:
[...]
 to help you unless you provide some code. 

Its help to be secured that nobody else heard of something like that either. So I reduced my 700 lines prog: const uint arity= 20*1024; struct Leaf{ int[ arity] data; } void init( inout Leaf* leaf){ leaf= new Leaf; } compiling with dmd -c resulted in the following table, where "Const" is the value to the left of "*1024" and "Time" is the compile time in ms. Const Time 2 75 4 282 6 641 8 1137 10 1950 12 3068 14 4388 16 5959 18 7648 20 9613 -manfred
Dec 08 2005
next sibling parent Derek Parnell <derek psych.ward> writes:
On Fri, 9 Dec 2005 00:39:12 +0000 (UTC), Manfred Nowak wrote:

 Jarrett Billingsley wrote:
 [...]
 to help you unless you provide some code. 

Its help to be secured that nobody else heard of something like that either. So I reduced my 700 lines prog: const uint arity= 20*1024; struct Leaf{ int[ arity] data; } void init( inout Leaf* leaf){ leaf= new Leaf; } compiling with dmd -c

Changing to a class causes no time variations. const uint arity= 20*1024; class Leaf{ int[arity] data; } void init( inout Leaf leaf){ leaf= new Leaf; } Changing to a dynamic array also cause no time variations. const uint arity= 20*1024; struct Leaf{ int[] data; } void init( inout Leaf* leaf){ leaf= new Leaf[arity]; } -- Derek (skype: derek.j.parnell) Melbourne, Australia "A learning experience is one of those things that says, 'You know that thing you just did? Don't do that.'" - D.N. Adams 9/12/2005 12:00:18 PM
Dec 08 2005
prev sibling next sibling parent "Lionello Lunesu" <lio remove.lunesu.com> writes:
I've tried to initialize that array with "void", but it makes not 
difference.
http://www.digitalmars.com/d/arrays.html (look for "Void Initialization")
I guess the "void initializer" only changes run-time behaviour?

const uint arity= 20*1024;
struct Leaf{
  int[ arity] data = void;
}
void init( inout Leaf* leaf){
  leaf= new Leaf;
}

L. 
Dec 08 2005
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Manfred Nowak schrieb am 2005-12-09:
 Jarrett Billingsley wrote:
 [...]
 to help you unless you provide some code. 

Its help to be secured that nobody else heard of something like that either. So I reduced my 700 lines prog: const uint arity= 20*1024; struct Leaf{ int[ arity] data; } void init( inout Leaf* leaf){ leaf= new Leaf; } compiling with dmd -c resulted in the following table, where "Const" is the value to the left of "*1024" and "Time" is the compile time in ms. Const Time 2 75 4 282 6 641 8 1137 10 1950 12 3068 14 4388 16 5959 18 7648 20 9613

Added to DStress as http://dstress.kuehne.cn/run/c/const_28_A.d http://dstress.kuehne.cn/run/c/const_28_B.d http://dstress.kuehne.cn/run/c/const_28_C.d http://dstress.kuehne.cn/run/c/const_28_D.d http://dstress.kuehne.cn/run/c/const_28_E.d http://dstress.kuehne.cn/run/c/const_28_F.d http://dstress.kuehne.cn/run/c/const_28_G.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDnUY93w+/yD4P9tIRAh//AJ9cfU6h/0lC6XM9CzS+6CdFL7CIGgCfa/ud xlns0uHsdPlqqSAKyHsR1hY= =AW5n -----END PGP SIGNATURE-----
Dec 16 2005
prev sibling parent reply "Kris" <fu bar.com> writes:
Don't know if it's related, but sometimes the compile/link cycle hangs on 
me. Very rare, but it does happen, and has done for perhaps a year. I don't 
have the patience to wait 5s or more, so just ctrl-c it and compile again. 
Happened most recently last Monday, but I don't have the console message 
that either DMD or Optlink spat out ... will save it next time, if there's 
any value in that.

Seems like you've got something reproducable though ...


"Manfred Nowak" <svv1999 hotmail.com> wrote in message 
news:Xns9725CE161D105svv1999hotmailcom 63.105.9.61...
I am experimenting with implementations for AA's and found that the
 times for the compilation with DMD 0.140, 0.141 are strongly
 influenced by the values of some integer constants I use in the
 definitions of my data structures.

 Depending on that values the compile times vary from some seconds to
 100 minutes.

 I do not use templates. Therefore I am somewhat surprised.

 Somebody has a clue?

 -manfred 

Dec 07 2005
next sibling parent reply John Reimer <terminal.node gmail.com> writes:
Kris wrote:
 Don't know if it's related, but sometimes the compile/link cycle hangs on 
 me. Very rare, but it does happen, and has done for perhaps a year. I don't 
 have the patience to wait 5s or more, so just ctrl-c it and compile again. 
 Happened most recently last Monday, but I don't have the console message 
 that either DMD or Optlink spat out ... will save it next time, if there's 
 any value in that.
 
 Seems like you've got something reproducable though ...
 
 

Funny you should mention this. It has happened to me also at least twice in the last week. I thought it was my computer glitching out. I ended up pressing control-c and recompiling again, none the worse. -JJR
Dec 07 2005
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"John Reimer" <terminal.node gmail.com> wrote in message 
news:dn7olp$2i10$1 digitaldaemon.com...
 Funny you should mention this.  It has happened to me also at least twice 
 in the last week.  I thought it was my computer glitching out.  I ended up 
 pressing control-c and recompiling again, none the worse.

I sometimes get this too.. usually it'll finish in a little while (maybe 10 seconds), but sometimes, rarely, I have to kill the process. I always figured it was something weird going on with ConTEXT, as I just run DMD with a macro key.
Dec 07 2005
prev sibling parent "Kris" <fu bar.com> writes:
Just happened again. Upon a ctrl-c, this message is emmited to the console:

--- errorlevel -1073741510




"Kris" <fu bar.com> wrote in message news:dn7ktn$2due$1 digitaldaemon.com...
 Don't know if it's related, but sometimes the compile/link cycle hangs on 
 me. Very rare, but it does happen, and has done for perhaps a year. I 
 don't have the patience to wait 5s or more, so just ctrl-c it and compile 
 again. Happened most recently last Monday, but I don't have the console 
 message that either DMD or Optlink spat out ... will save it next time, if 
 there's any value in that.

 Seems like you've got something reproducable though ...


 "Manfred Nowak" <svv1999 hotmail.com> wrote in message 
 news:Xns9725CE161D105svv1999hotmailcom 63.105.9.61...
I am experimenting with implementations for AA's and found that the
 times for the compilation with DMD 0.140, 0.141 are strongly
 influenced by the values of some integer constants I use in the
 definitions of my data structures.

 Depending on that values the compile times vary from some seconds to
 100 minutes.

 I do not use templates. Therefore I am somewhat surprised.

 Somebody has a clue?

 -manfred


Dec 10 2005