How to make a slow compile

evilrat evilrat666 at gmail.com
Thu Aug 21 15:04:43 UTC 2025


On Thursday, 21 August 2025 at 13:52:32 UTC, Monkyyy wrote:
> On Thursday, 21 August 2025 at 05:38:08 UTC, evilrat 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?
>>
>> I have godot-dlang builds (with dub/LDC) compiling for about 3 
>> minutes on top hardware. But this is more of a config issues 
>> and how LDC handles all that code symbols(functions, etc...), 
>> having to build a spaghetti templates for over 1k classes is 
>> no joke. This is something i am planning to look into, having 
>> a tiny WASM game scripts for 30 Mb shared library is no fun. 
>> This is mainly because it uses dub import-paths AND 
>> source-paths together for usability simplicity reasons. Would 
>> be much faster to remove source-paths and properly configure 
>> D's -i include pattern, that requires figuring dub 
>> configuration that properly uses predefined env variables.
>
>> spaghetti template
>
> Can you post what you believe is slow?
>

https://github.com/Circular-Studios/Dash

here is a good example, this project does heavily rely on 
reflection, similar to godot-dlang but going even further to also 
do serialization and other things, all that resulted in long 
builds. though it'll probably no longer compiles without major 
rewrite, i remember it was like 40 seconds builds after every 
source change.

https://github.com/Circular-Studios/Dash



More information about the Digitalmars-d-learn mailing list