dmd
dmd copied to clipboard
Make -vtemplates measure the time spent instantiating
This times the total time for a given instantiation, but the individual measurements can be done in a followup
Thanks for your pull request, @maxhaton!
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 22772 | enhancement | -vtemplates should measure the cost of the instantiations |
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#13653"
CI should fail on vtemplates test but my druntime is broken so relying on this to see exact what happens
I'm not convinced that this is of general use. I know that at Symmetry template instantiation time is important, but since you are instrumenting this anyway why do you need it in the release compiler?
Yes, it is useful.
It costs nothing, and anyone actually using D in production will at some care about template bloat. -vtemplates as it stands isn't actually very useful for eliminating bloat because you don't know the contribution of a given template to anything you can actually measure.
In fact, dmd is massively worse than ldc because ldc has -ftime-trace
(more on that in a PR probably in a week or so, unless I've nerdsniped
martin).
Also, just to nip something in the bud immediately: The idea that the users of a language don't care about what the compiler does as long as the result is good, isn't really true for a language like D.
There is my case for inclusion what is yours for not including it (the idea, the specifics can he whittled down, I did this in minutes)?
On Thu, 17 Feb 2022, 13:15 Razvan Nitu, @.***> wrote:
I'm not convinced that this is of general use. I know that at Symmetry template instantiation time is important, but since you are instrumenting this anyway why do you need it in the release compiler?
— Reply to this email directly, view it on GitHub https://github.com/dlang/dmd/pull/13653#issuecomment-1042937996, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLI75FVV25IV5QMTQ2OFETU3TYGDANCNFSM5OMXSMKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
@maxhaton Can you make the test suite pass?
ping @maxhaton