[Issue 10716] New: Horrifically slow compilation for array literals inside functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 26 03:19:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10716

           Summary: Horrifically slow compilation for array literals
                    inside functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2013-07-26 03:19:49 PDT ---
I found this in the DMD test suite. One file, test44.d, takes much longer to
compile than any of the others. The actual test is basically just this:
---
void main()
{
int [] x = [
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
];

}
---
but copy the 1,1,1,1,  line a thousand times. 
The slow compilation happens in the glue layer: compiling with dmd -o- is
instantaneous, but dmd -c takes minutes.
Which is really silly since it can should just compile to a malloc + memcpy
from data segment.
Compiling with -O makes it even worse.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list