dmd/changelog/dmd.ftime-trace.dd
Dennis 04025fdba6
Add --ftime-trace to dmd (#16363)
* Add --ftime-trace to dmd

* Refactor timetrace code for dmd.

Pass Outbuffer by ref,
move timetrace filename logic to main.d
2024-07-29 14:48:03 +02:00

16 lines
687 B
Text

Build time profiling has been added to dmd
The `-ftime-trace` switch that the LDC compiler already has, is now also available in dmd.
It can be used to figure out which parts of your code take the longest to compile, so you can optimize your build times.
$(CONSOLE
dmd -ftime-trace app.d
)
This will output `app.o.time-trace`.
A different output file can be selected with `-ftime-trace-file=trace.json`.
The output is in Google Chrome's profiler format, which can be viewed in an interactive viewer like [ui.perfetto.dev](https://ui.perfetto.dev).
See also this YouTube tutorial: [Easily Reduce Build Times by Profiling the D Compiler](https://www.youtube.com/watch?v=b8wZqU5t9vs)