View mode: basic / threaded / horizontal-split · Log in · Help
December 07, 2005
compile time variations
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
December 07, 2005
Re: compile time variations
"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.
December 07, 2005
Re: compile time variations
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
December 07, 2005
Re: compile time variations
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
December 07, 2005
Re: compile time variations
"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.
December 09, 2005
Re: compile time variations
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
December 09, 2005
Re: compile time variations
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
December 09, 2005
Re: compile time variations
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.
December 11, 2005
Re: compile time variations
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
>
>
December 16, 2005
Re: compile time variations
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
Top | Discussion index | About this forum | D home