Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
February 22, 2020 Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
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. |
February 22, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | 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.
|
February 22, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | 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.
|
February 22, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | 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 |
February 22, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | 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:
>> Is there a dmd flag that shows the code after template instantiations has been performed?
>
> The -vcg-ast flag does that.
The d.cg files still contain templates, so it appears like they're instantiated after -vcg-ast?
|
February 22, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to drathier | On Saturday, 22 February 2020 at 12:24:56 UTC, drathier wrote:
> 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:
>>> Is there a dmd flag that shows the code after template instantiations has been performed?
>>
>> The -vcg-ast flag does that.
>
> The d.cg files still contain templates, so it appears like they're instantiated after -vcg-ast?
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.
|
February 23, 2020 Re: Speeding up compilation of template-heavy code | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | 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.
|
Copyright © 1999-2021 by the D Language Foundation