digitalmars.D.learn - How to profile compile times of a source code?
- Ahmet Sait (9/9) Jan 30 2021 I'm looking for ways to figure out what parts of the code slows
- Stefan Koch (7/16) Jan 30 2021 I have a way of getting the profile data your are after.
- Stefan Koch (6/9) Jan 30 2021 you will want to take a look at the PhaseHist command which shows
- Imperatorn (3/11) Jan 31 2021 Interesting. Is this something that we could get into dmd with a
- Johan Engelen (8/20) Jan 31 2021 Try LDC 1.25 (now in beta testing) with --ftime-trace. Clang has
- Imperatorn (2/17) Jan 31 2021 Cool, will take a look 👍
- Anonymouse (4/12) Jan 31 2021 Does ldc produce traces in a format that Tracy supports? I can't
- Boris Carvajal (2/15) Jan 31 2021 Use the 'import-chrome' tool bundled in Tracy to convert it.
- Johan (9/14) Jan 31 2021 Indeed. It's a little annoying that you will see many horizontal
- Vladimir Panteleev (6/8) Aug 08 2021 You could try some of the tools listed on the wiki for build time
I'm looking for ways to figure out what parts of the code slows down the compiler other than brute force trial. Can I use -vtemplates switch for this? Would -v (verbose) switch helpful in some way? How would I know if my bottleneck is ctfe or templates? How do the compiler devs approach this issue? I'm interested in all kinds of tricks to the point of debugging the compiler itself although anything less complicated would be appreciated.
Jan 30 2021
On Saturday, 30 January 2021 at 22:47:39 UTC, Ahmet Sait wrote:I'm looking for ways to figure out what parts of the code slows down the compiler other than brute force trial. Can I use -vtemplates switch for this? Would -v (verbose) switch helpful in some way? How would I know if my bottleneck is ctfe or templates? How do the compiler devs approach this issue? I'm interested in all kinds of tricks to the point of debugging the compiler itself although anything less complicated would be appreciated.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
Jan 30 2021
On Saturday, 30 January 2021 at 23:34:50 UTC, Stefan Koch wrote:this special version of dmd will generate a trace file which can be read with the included printTraceHeader toolyou will want to take a look at the PhaseHist command which shows you the compiler phase that took the most time. Alternative I recommend using callgrind to profile where dmd spents most of it's time. For that to be useful you need a debug build of dmd though.
Jan 30 2021
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:Interesting. Is this something that we could get into dmd with a switch? 🤔[...]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
Jan 31 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: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 -JohanOn Saturday, 30 January 2021 at 22:47:39 UTC, Ahmet Sait wrote:Interesting. Is this something that we could get into dmd with a switch? 🤔[...]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
Jan 31 2021
On Sunday, 31 January 2021 at 12:31:59 UTC, Johan Engelen wrote:On Sunday, 31 January 2021 at 12:16:50 UTC, Imperatorn wrote:Cool, will take a look 👍On Saturday, 30 January 2021 at 23:34:50 UTC, Stefan Koch wrote: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[...]Interesting. Is this something that we could get into dmd with a switch? 🤔
Jan 31 2021
On Sunday, 31 January 2021 at 12:31:59 UTC, Johan Engelen wrote: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 -JohanDoes ldc produce traces in a format that Tracy supports? I can't seem to open the generated *.time-trace files with it. (tracy 0.7.5-1 installed from Arch Linux AUR.)
Jan 31 2021
On Sunday, 31 January 2021 at 16:13:24 UTC, Anonymouse wrote:On Sunday, 31 January 2021 at 12:31:59 UTC, Johan Engelen wrote:Use the 'import-chrome' tool bundled in Tracy to convert it.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 -JohanDoes ldc produce traces in a format that Tracy supports? I can't seem to open the generated *.time-trace files with it. (tracy 0.7.5-1 installed from Arch Linux AUR.)
Jan 31 2021
On Sunday, 31 January 2021 at 16:39:12 UTC, Boris Carvajal wrote:On Sunday, 31 January 2021 at 16:13:24 UTC, Anonymouse wrote:Indeed. It's a little annoying that you will see many horizontal 'traces' in tracy and probably will have to scroll all the way down to see the actual LDC trace. It's a tradeoff I made between nicely displayed trace block names, vs. using only a few categories... Maybe other people can chime in a figure out a better way of outputting the trace item names (we are using LLVM functionality here btw). -JohanDoes ldc produce traces in a format that Tracy supports? I can't seem to open the generated *.time-trace files with it. (tracy 0.7.5-1 installed from Arch Linux AUR.)Use the 'import-chrome' tool bundled in Tracy to convert it.
Jan 31 2021
On Saturday, 30 January 2021 at 22:47:39 UTC, Ahmet Sait wrote:I'm looking for ways to figure out what parts of the code slows down the compiler other than brute force trial.You could try some of the tools listed on the wiki for build time profiling: https://wiki.dlang.org/Development_tools#Build_time_profiling (intentional bump to aid search results, as apparently this list is not very well known)
Aug 08 2021