www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10716] New: Horrifically slow compilation for array literals inside functions

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: clugdbug yahoo.com.au



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: -------
Jul 26 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10716




19:44:18 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2388

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10716


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com



PDT ---


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10716




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9c97ebe61f85fef25bab8ff3d310a78fb56e38ba
fix Issue 10716 - Horrifically slow compilation for array literals inside
functions

https://github.com/D-Programming-Language/dmd/commit/c9235a9ce3dc0e8dc97b4b9a9c8b83a31950e8f8


fix Issue 10716 - Horrifically slow compilation for array literals insid...

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