digitalmars.D.learn - Speeding up compilation of template-heavy code
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (6/6) Feb 22 2020 We're looking for a way to speed up compilation of template-heavy
- Dennis (2/4) Feb 22 2020 The -vcg-ast flag does that.
- drathier (3/8) Feb 22 2020 The d.cg files still contain templates, so it appears like
- Stefan Koch (6/15) Feb 22 2020 no. -vcg-ast runs directly before codegen.
- drathier (4/9) Feb 23 2020 Thanks, I didn't even consider the possibility of a compiler
- Stefan Koch (4/10) Feb 22 2020 I have patches which add some tracing functionality.
- Seb (2/8) Feb 22 2020 https://github.com/CyberShadow/dmdprof
We're looking for a way to speed up compilation of template-heavy code. So we are trying to find out which parts of the code that is most costly to compile. Is there a dmd flag that shows the code after template instantiations has been performed? Or some other dmd flag that can help out finding hot-spots in the compiler in our case.
Feb 22 2020
On Saturday, 22 February 2020 at 11:26:19 UTC, Per Nordlöw wrote:Is there a dmd flag that shows the code after template instantiations has been performed?The -vcg-ast flag does that.
Feb 22 2020
On Saturday, 22 February 2020 at 11:53:38 UTC, Dennis wrote:On Saturday, 22 February 2020 at 11:26:19 UTC, Per Nordlöw wrote:The d.cg files still contain templates, so it appears like they're instantiated after -vcg-ast?Is there a dmd flag that shows the code after template instantiations has been performed?The -vcg-ast flag does that.
Feb 22 2020
On Saturday, 22 February 2020 at 12:24:56 UTC, drathier wrote:On Saturday, 22 February 2020 at 11:53:38 UTC, Dennis wrote:no. -vcg-ast runs directly before codegen. All ast-rewriteing has already happend at that point. The reason it contains the template declarations is because they are still in the ast. There is no point in removing them.On Saturday, 22 February 2020 at 11:26:19 UTC, Per Nordlöw wrote:The d.cg files still contain templates, so it appears like they're instantiated after -vcg-ast?Is there a dmd flag that shows the code after template instantiations has been performed?The -vcg-ast flag does that.
Feb 22 2020
On Saturday, 22 February 2020 at 17:44:52 UTC, Stefan Koch wrote:no. -vcg-ast runs directly before codegen. All ast-rewriteing has already happend at that point. The reason it contains the template declarations is because they are still in the ast. There is no point in removing them.Thanks, I didn't even consider the possibility of a compiler mutating the ast in-place. Spent too much time writing Haskell, I guess.
Feb 23 2020
On Saturday, 22 February 2020 at 11:26:19 UTC, Per Nordlöw wrote:We're looking for a way to speed up compilation of template-heavy code. So we are trying to find out which parts of the code that is most costly to compile. Is there a dmd flag that shows the code after template instantiations has been performed? Or some other dmd flag that can help out finding hot-spots in the compiler in our case.I have patches which add some tracing functionality. Another approach is to throw the -v flag and just count which semantic steps seem to take a long time.
Feb 22 2020
On Saturday, 22 February 2020 at 11:26:19 UTC, Per Nordlöw wrote:We're looking for a way to speed up compilation of template-heavy code. So we are trying to find out which parts of the code that is most costly to compile. Is there a dmd flag that shows the code after template instantiations has been performed? Or some other dmd flag that can help out finding hot-spots in the compiler in our case.https://github.com/CyberShadow/dmdprof
Feb 22 2020