Bug 6771 – Jagged array and init causing DMD to take a LONG time to compile.
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-10-05T07:37:00Z
Last change time
2013-03-12T12:21:56Z
Assigned to
nobody
Creator
damianday
Comments
Comment #0 by damianday — 2011-10-05T07:37:37Z
const MAXX = 40;
const MAXY = 40;
struct MyStruct
{
ushort Var1;
ushort Var2;
ushort Var3;
// NOTE: comment out these variables below and it
// will compile faster..
ubyte Var4;
ubyte Var5;
ubyte Var6;
ubyte Var7;
ubyte Var8;
ubyte Var9;
}
public class MyClass
{
public MyStruct[MAXX * 3][MAXY * 3] MArr;
public this()
{
MArr = MArr.init; // <-- THIS LINE
}
}
The above source code will cause the DMD compiler to take a long time to compile (minutes? hours?). Commenting out the lines suggested will speed the compilation up enough to see it succeed.
Comment #1 by yebblies — 2012-02-01T06:26:21Z
*** This issue has been marked as a duplicate of issue 2396 ***
Comment #2 by damianday — 2013-03-12T10:59:57Z
*** This issue has been marked as a duplicate of issue 8828 ***
Comment #3 by code — 2013-03-12T12:21:56Z
*** This issue has been marked as a duplicate of issue 2396 ***