dmd
dmd copied to clipboard
Merge and use time trace sources into dmd
For anyone who doesn't know this is the time-trace facility from LDC. It's effectively a one-stop-shop for profiling compile times, simultaneously providing a simple high level view (with an appropriate profile viewer) of compilation (at the level of files and imports of those files)
The timetrace.d file is in common so it can eventually be used in the backend (code generation, especially as a symptom of overzealous use of templates, is not free and object emission can be very not free since the dmd implementation of (say) ELF doesn't scale to large N very well). At the moment however it's only used by the frontend.
@JohanEngelen I had to remove some phobos usage, hopefully i didn't alter anything Also @thewilsonator @kinke to make you aware of an upcoming change if this gets merged.
Thanks for your pull request, @maxhaton!
Bugzilla references
Your PR doesn't reference any Bugzilla issue.
If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
Testing this PR locally
If you don't have a local development environment setup, you can use Digger to test this PR:
dub run digger -- build "master + dmd#13965"
This isn't completely ready yet but I wanna run it through the CI pipelines
dmd.globals thing is going to be annoying. that being said within a reasonable definition of common I guess the globals should be common to them both?
As a user of --ftime-trace in LDC, I like having the same in dmd, especially with the same command line interface / output format.
@kinke when this gets merged, can you use the same source as DMD or will LDC keep its own time trace implementation? In the latter case, the version (LDC) branches in this PR are unnecessary.
This isn't completely ready yet but I wanna run it through the CI pipelines
I've marked it as draft, please notify when it's ready for review.
@JohanEngelen I had to remove some phobos usage, hopefully i didn't alter anything.
Add a comment to the copied function(s) with a link to phobos. Such that bugfixes in Phobos may at some point also land in the copied functions. (fwiw: I am against the DMD design choice to not use the Dlang standard library).
@JohanEngelen I had to remove some phobos usage, hopefully i didn't alter anything.
Add a comment to the copied function(s) with a link to phobos. Such that bugfixes in Phobos may at some point also land in the copied functions. (fwiw: I am against the DMD design choice to not use the Dlang standard library).
It was only string manipulation, just pointed it out in case someone is parsing it somewhere (for example).
@maxhaton Any progress on this?
@maxhaton ping
Does this work include tracing of memory usage?
Does this work include tracing of memory usage?
Yes. Use LDC ;-)
Does this solution include template instance types into the trace?
Does this solution include template instance types into the trace?
Are you saying memory tracing is not included in this DMD PR?
What I am saying is: just use LDC. It has this functionality for a while now, and you can see for yourself what it does and does not do.
I don't understand how this works. How are probes performed? By stopping the process? Because I see no injection of probes anywhere in the existing dmd source code. Ping, @maxhaton.
Could you please provide a link to the documentation on what this switch does?
There's no written documentation yet, but I created a video tutorial: https://forum.dlang.org/post/[email protected]
Rebooted in https://github.com/dlang/dmd/pull/16363
Nice. I don't really have time for much DMD stuff these days but I'll try and help you get that reviewed and merged @dkorpel
On Sun, 7 Apr 2024, 20:23 Dennis, @.***> wrote:
Rebooted in #16363 https://github.com/dlang/dmd/pull/16363
— Reply to this email directly, view it on GitHub https://github.com/dlang/dmd/pull/13965#issuecomment-2041576510, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLI75CSOYFBKSUJC45NQLDY4GMLFAVCNFSM5S3EZ4DKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBUGE2TONRVGEYA . You are receiving this because you were mentioned.Message ID: @.***>