[Issue 14571] Large static arraus seem to lock up DMD

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 11 02:52:37 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14571

ag0aep6g at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |performance
                 CC|                            |ag0aep6g at gmail.com
           Hardware|x86_64                      |All
                 OS|Windows                     |All

--- Comment #1 from ag0aep6g at gmail.com ---
A little shell script with a reduced test case:
----
> times
for i in `seq 2 2 60`
do
cat > test.d << code
struct InputPoint
{
    double position;
}
struct GrowableArray
{
    InputPoint[$i*1024] data;
}
code
(echo -n "$i "; time -f %U dmd -c test.d 2>&1) | tee -a times
done
gnuplot -e 'set terminal dumb; plot "times"'
----

Output:
----
2 0.01
4 0.04
6 0.08
8 0.13
10 0.22
12 0.30
14 0.40
16 0.53
18 0.70
20 0.87
22 1.04
24 1.32
26 1.50
28 1.82
30 2.15
32 2.62
34 3.22
36 4.05
38 5.19
40 6.23
42 7.68
44 10.13
46 10.97
48 11.97
50 14.07
52 22.59
54 24.41
56 26.22
58 33.27
60 33.24



  35 ++----------+----------+-----------+-----------+----------+----------++
     +           +          +           +           +       "times"   A  A A
     |                                                                     |
  30 ++                                                                   ++
     |                                                                     |
  25 ++                                                               A   ++
     |                                                              A      |
     |                                                            A        |
  20 ++                                                                   ++
     |                                                                     |
     |                                                                     |
  15 ++                                                        A          ++
     |                                                                     |
     |                                                     A A             |
  10 ++                                                 A                 ++
     |                                                A                    |
   5 ++                                          A  A                     ++
     |                                       A A                           |
     +           +          +  A A A  A A A         +          +           +
   0 ++A--A-A-A--A-A-A--A-A-A-----------+-----------+----------+----------++
     0           10         20          30          40         50          60
----

That looks quadratic. Eww.

--


More information about the Digitalmars-d-bugs mailing list