www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - dmd compiler hang time

reply clayasaurus <clayasaurus gmail.com> writes:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I'm not sure if this is a bug, but compiling it will cause DMD to hang 
for a considerable amount of time.

Set MAX_PARTICLES to 2000 for a short hang, and anything over for a 
(exponentially?) longer hang. In the example I set it to 10000, which 
took ~5 minutes to compile on my machine.

DMD .141 linux
Dec 25 2005
next sibling parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

clayasaurus schrieb am 2005-12-25:
 I'm not sure if this is a bug, but compiling it will cause DMD to hang 
 for a considerable amount of time.

 Set MAX_PARTICLES to 2000 for a short hang, and anything over for a 
 (exponentially?) longer hang. In the example I set it to 10000, which 
 took ~5 minutes to compile on my machine.

 DMD .141 linux

 const int MAX_PARTICLES = 10000;

 /* Create our particle structure */
 struct particle
 {
     int   active; /* Active (Yes/No) */
     float life;   /* Particle Life   */
     float fade;   /* Fade Speed      */

     float r;      /* Red Value       */
     float g;      /* Green Value     */
     float b;      /* Blue Value      */

     float x;      /* X Position      */
     float y;      /* Y Position      */

     float xi;     /* X Direction     */
     float yi;     /* Y Direction     */

     float xg;     /* X Gravity       */
     float yg;     /* Y Gravity       */
 } 

 /* Our beloved array of particles */
 particle particles[MAX_PARTICLES];

Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_21_A.d http://dstress.kuehne.cn/run/a/array_initialization_21_B.d http://dstress.kuehne.cn/run/a/array_initialization_21_C.d http://dstress.kuehne.cn/run/a/array_initialization_21_D.d http://dstress.kuehne.cn/run/a/array_initialization_21_E.d http://dstress.kuehne.cn/run/a/array_initialization_21_F.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDr8ik3w+/yD4P9tIRAhrrAJ9/r3ZxceCkJRtPm8GDeR+3Mt/BxACbB4U+ 8+UoI/LmPdhHgjELz69sw9k= =nuOh -----END PGP SIGNATURE-----
Dec 27 2005
parent reply Dave <Dave_member pathlink.com> writes:
Thomas - thanks once again for your efforts w.r.t. DStress.

I have to ask though, why does the DStress "home page" show so poorly for DMD as
opposed to GDC? Is it because of the -fPIC -O failures?

Thanks,

- Dave

In article <4ut483-pn6.ln1 birke.kuehne.cn>, Thomas Kuehne says...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

clayasaurus schrieb am 2005-12-25:
 I'm not sure if this is a bug, but compiling it will cause DMD to hang 
 for a considerable amount of time.

 Set MAX_PARTICLES to 2000 for a short hang, and anything over for a 
 (exponentially?) longer hang. In the example I set it to 10000, which 
 took ~5 minutes to compile on my machine.

 DMD .141 linux

 const int MAX_PARTICLES = 10000;

 /* Create our particle structure */
 struct particle
 {
     int   active; /* Active (Yes/No) */
     float life;   /* Particle Life   */
     float fade;   /* Fade Speed      */

     float r;      /* Red Value       */
     float g;      /* Green Value     */
     float b;      /* Blue Value      */

     float x;      /* X Position      */
     float y;      /* Y Position      */

     float xi;     /* X Direction     */
     float yi;     /* Y Direction     */

     float xg;     /* X Gravity       */
     float yg;     /* Y Gravity       */
 } 

 /* Our beloved array of particles */
 particle particles[MAX_PARTICLES];

Added to DStress as http://dstress.kuehne.cn/run/a/array_initialization_21_A.d http://dstress.kuehne.cn/run/a/array_initialization_21_B.d http://dstress.kuehne.cn/run/a/array_initialization_21_C.d http://dstress.kuehne.cn/run/a/array_initialization_21_D.d http://dstress.kuehne.cn/run/a/array_initialization_21_E.d http://dstress.kuehne.cn/run/a/array_initialization_21_F.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDr8ik3w+/yD4P9tIRAhrrAJ9/r3ZxceCkJRtPm8GDeR+3Mt/BxACbB4U+ 8+UoI/LmPdhHgjELz69sw9k= =nuOh -----END PGP SIGNATURE-----

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

Dave schrieb am 2005-12-30:
 I have to ask though, why does the DStress "home page" show so poorly for DMD
as
 opposed to GDC? Is it because of the -fPIC -O failures?

Yes, the summary lists the worst result per compiler and test case. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFDtgFF3w+/yD4P9tIRAidGAJ4pOeZCzGXEQ0jZNIY/nMb8vJOilACeJnUX mCVinHb/L6q+0DlyEP7ieCg= =ul1Y -----END PGP SIGNATURE-----
Jan 01 2006
prev sibling parent reply clayasaurus <clayasaurus gmail.com> writes:
Just realized the problem is fixed with

particle particles[MAX_PARTICLES] = void;

But I am still amazed at the time it takes to initialize large arrays, I 
didn't know it was done at compile time.

clayasaurus wrote:
 I'm not sure if this is a bug, but compiling it will cause DMD to hang 
 for a considerable amount of time.
 
 Set MAX_PARTICLES to 2000 for a short hang, and anything over for a 
 (exponentially?) longer hang. In the example I set it to 10000, which 
 took ~5 minutes to compile on my machine.
 
 DMD .141 linux
 
 
 ------------------------------------------------------------------------
 
 const int MAX_PARTICLES = 10000;
 
 /* Create our particle structure */
 struct particle
 {
     int   active; /* Active (Yes/No) */
     float life;   /* Particle Life   */
     float fade;   /* Fade Speed      */
 
     float r;      /* Red Value       */
     float g;      /* Green Value     */
     float b;      /* Blue Value      */
 
     float x;      /* X Position      */
     float y;      /* Y Position      */
 
     float xi;     /* X Direction     */
     float yi;     /* Y Direction     */
 
     float xg;     /* X Gravity       */
     float yg;     /* Y Gravity       */
 } 
 
 /* Our beloved array of particles */
 particle particles[MAX_PARTICLES];

Dec 27 2005
parent Lars Ivar Igesund <larsivar igesund.net> writes:
You might be able to check this with the readelf tool in binutils.

An object file has two types of reserved sections for a programs data.

The section named .bss holds uninitialized data which is initialized with
zeros at program start time. The sections .data and .data1 holds
initialized data already stored in the object file. The data might also be
stored in other sections, but in those cases it might be difficult to find
it without knowing the contents of quite a few other sections.

I suppose this is a feature to speed up program startup on the expense of
compile time.

IMO this is no bug, although the docs probably should be clearer on the
implications of how you initialize your arrays.

Lars Ivar

clayasaurus wrote:

 Just realized the problem is fixed with
 
 particle particles[MAX_PARTICLES] = void;
 
 But I am still amazed at the time it takes to initialize large arrays, I
 didn't know it was done at compile time.
 
 clayasaurus wrote:
 I'm not sure if this is a bug, but compiling it will cause DMD to hang
 for a considerable amount of time.
 
 Set MAX_PARTICLES to 2000 for a short hang, and anything over for a
 (exponentially?) longer hang. In the example I set it to 10000, which
 took ~5 minutes to compile on my machine.
 
 DMD .141 linux
 
 
 ------------------------------------------------------------------------
 
 const int MAX_PARTICLES = 10000;
 
 /* Create our particle structure */
 struct particle
 {
     int   active; /* Active (Yes/No) */
     float life;   /* Particle Life   */
     float fade;   /* Fade Speed      */
 
     float r;      /* Red Value       */
     float g;      /* Green Value     */
     float b;      /* Blue Value      */
 
     float x;      /* X Position      */
     float y;      /* Y Position      */
 
     float xi;     /* X Direction     */
     float yi;     /* Y Direction     */
 
     float xg;     /* X Gravity       */
     float yg;     /* Y Gravity       */
 }
 
 /* Our beloved array of particles */
 particle particles[MAX_PARTICLES];


Dec 27 2005