CompileTime performance measurement

safety0ff via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 8 09:52:47 PDT 2016


On Sunday, 4 September 2016 at 00:04:16 UTC, Stefan Koch wrote:
>
> ... I have now implemented another pseudo function called 
> __ctfeTicksMs.
> [Snip]
>
> This does allow meaningful compiletime performance tests to be 
> written.
> spanning both CTFE and template-incitations timeings.
>
> Please tell me what you think.

I think automated ctfe profiling would be much better and the 
byte-code interpreter seems like a great platform to build this 
onto.

For example, using a command line switch to enable profiling 
which outputs something similar to gprof's flat profile.

Skimming the byte-code work it seems like it is too early to add 
this yet.

My thoughts on __ctfeTicksMs:
- it isn't very meaningful for users without intimate compiler 
knowledge
- it requires writing boilerplate code over and over for profiling
- doesn't seem like it would work well for functions that get 
executed multiple times

While it might be a useful compiler developer hack, I do not 
think it should become a user primitive.


More information about the Digitalmars-d mailing list