How to make a slow compile
Andrey Zherikov
andrey.zherikov at gmail.com
Wed Aug 27 01:04:11 UTC 2025
On Sunday, 24 August 2025 at 18:21:50 UTC, monkyyy wrote:
> On Sunday, 24 August 2025 at 13:59:46 UTC, Andrey Zherikov
> wrote:
>> On Wednesday, 20 August 2025 at 15:33:45 UTC, monkyyy wrote:
>>> once again dconf contains people who talk about compile speed
>>> as if it can be slow
>>>
>>> What are they doing? Even my worse compile time abstraction
>>> was O(n^2) or maybe some awful string concatenation of an
>>> entire file; still effectively instant
>>>
>>> Wheres a 1000 line file that does something meta
>>> programmingly useful that takes 5 minutes?
>>>
>>> Do they lose track of what the compiler is even doing? Do
>>> they turn off the template recursion depth limit?
>>
>> My recent experience: removing usage of SumType and replacing
>> it with my own solution reduced dmd memory usage from 6GB to
>> 1.7GB and improved compilation speed.
>
> What sort of difference did you do? Did the memory usage matter
> for speed at all?
I was speaking about [this
change](https://github.com/andrey-zherikov/argparse/pull/214)
where I replaced `std.SumType` with my own implementation using
`union`.
So I got lower memory usage and faster compilation.
More information about the Digitalmars-d-learn
mailing list