How to profile compile times of a source code?

Johan Engelen j at j.nl
Sun Jan 31 12:31:59 UTC 2021


On Sunday, 31 January 2021 at 12:16:50 UTC, Imperatorn wrote:
> On Saturday, 30 January 2021 at 23:34:50 UTC, Stefan Koch wrote:
>> On Saturday, 30 January 2021 at 22:47:39 UTC, Ahmet Sait wrote:
>>> [...]
>>
>> I have a way of getting the profile data your are after.
>> Get the dmd_tracing_20942 branch from 
>> https://github.com/UplinkCoder/dmd
>> Compile that version of dmd.
>> this special version of dmd will generate a trace file which 
>> can be read with the included printTraceHeader tool
>
> Interesting. Is this something that we could get into dmd with 
> a switch? 🤔

Try LDC 1.25 (now in beta testing) with --ftime-trace. Clang has 
the same option, so you can read more about it online in that 
context. Be sure to check out the related commandline flags.
I recommend the Tracy UI to look at traces, because it is by far 
the fastest viewer of large traces. 
https://github.com/wolfpld/tracy

-Johan



More information about the Digitalmars-d-learn mailing list