Performance

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Fri May 30 23:36:20 PDT 2014


On Sat, 2014-05-31 at 07:32 +0200, dennis luehring via Digitalmars-d
wrote:
> faulty benchmark

Indeed.

> -do not benchmark "format"
> 
> -use a dummy-var - just add(overflow is not a problem) your plus() 
> results to it and return that in your main - preventing dead code 
> optimization in any way
> 
> -introduce some sort of random-value into your plus() code, for example
> use an random-generator or the int-casted pointer to program args as 
> startup value
> 
> -do not benchmark anything without millions of loops - use the average 
> as the result
> 
> anything else does not makes sense

As well as the average (mean), you must provide standard deviation and
degrees of freedom so that a proper error analysis and t-tests are
feasible. Or put it another way: even if you quote a mean with knowing
how many in the sample and what the spread is you cannot judge the error
and so cannot make deductions or inferences. 

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list