[Issue 13152] [REG2.064.2] Compiler high cpu usage and never ends
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sun Jul 20 01:55:43 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13152
Vladimir Panteleev <thecybershadow at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |thecybershadow at gmail.com
Summary|Compiler high cpu usage and |[REG2.064.2] Compiler high
|never ends |cpu usage and never ends
--- Comment #2 from Vladimir Panteleev <thecybershadow at gmail.com> ---
Domingo, can you try removing "public" from the imports in each module? I think
that's what's causing the slowdown.
I can reproduce the problem (and arrive at the same bisect result) with the
following synthetic test case:
////// a.d /////
public import a;
public import b;
.....
public import y;
public import z;
////////////////
Then copy a.d to b.d, c.d, ..., z.d.
You can use the following program to generate the test files:
///////////////////// gen.d ////////////////////
import std.stdio;
enum last = 'z';
void main()
{
for (char c = 'a'; c<=last; c++)
{
auto f = File(c ~ ".d", "w");
for (char c2 = 'a'; c2<=last; c2++)
f.writefln("public import %s;", c2);
}
}
////////////////////////////////////////////////
Running `dmd a.d` will take a very long time.
Introduced in https://github.com/D-Programming-Language/dmd/pull/2448 (between
2.063 and 2.064.2).
--
More information about the Digitalmars-d-bugs
mailing list