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.