Compiletime Vs Runtime bencmarks

D_Learner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Aug 18 00:12:41 PDT 2015


On Monday, 17 August 2015 at 22:01:32 UTC, John Colvin wrote:
> On Monday, 17 August 2015 at 17:48:22 UTC, D_Learner wrote:
>> On Monday, 17 August 2015 at 14:52:18 UTC, Edwin van Leeuwen 
>> wrote:
>>> [...]
>>
>> The surprisingly, the D-profiler gives plausible results:-
>> Algorithm1
>> 2921           int rtime_pre.bm_rmatch (runtime )
>> 2122           int ctime_pre.bm_cmatch  (compiletime )
>>
>> 1317            int rtime_pre.bmh_rmatch  (runtime )
>> 1099            int ctime_pre.bmh_cmatch   (compiletime )
>>
>>
>> 3959             int rtime_pre.ag_rmatch     (runtime )
>> 2688             pure int ctime_pre.ag_cmatch   (compiletime )
>>
>> This suggests that my timer design has some flaw ;)
>
> std.datetime.StopWatch is the easiest way to do timing 
> manually, or just use std.datetime.benchmark

My code already uses std.datetime.StopWatch , but I get results 
which are no match to the D compilers.


More information about the Digitalmars-d-learn mailing list