Compiletime Vs Runtime bencmarks

D_Learner via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 17 10:48:20 PDT 2015


On Monday, 17 August 2015 at 14:52:18 UTC, Edwin van Leeuwen 
wrote:
> On Monday, 17 August 2015 at 14:43:35 UTC, D_Learner wrote:
>> Hello everyone . I need advice on my first D-project . I have 
>> uploaded it at :-
>>
>> Current Results  for the pattern="GCAGAGAG"  are as below :-
>>
>> BM_Runtime          = 366 hnsecs     position=   513
>> BM_Compile-time     = 294 hnsecs     position   =513
>>
>> BMH_Runtime         = 174 hnsecs     position=   513
>> BMH_Compile-time    = 261 hnsecs     position=   513
>>
>> AG_Run-time         = 258 hnsecs    position=   513
>> AG_Compile-time     = 268 hnsecs    position=   513
>>
>>
>> Running the code : dmd -J.  matcher.d inputs.d  rtime_pre.d 
>> ctime_pre.d && numactl --physcpubind=0 ./matcher
>>
>
> Hi,
>
> What happens if you run each algorithm many (say 100000) times. 
> The current times seem to short to be reliable (variation in 
> runtimes would be too great).
>
> Regards, Edwin

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 ;)



More information about the Digitalmars-d-learn mailing list