[Shootout-list] What people say about shootout

Jon Harrop jon@ffconsultancy.com
Fri, 29 Apr 2005 17:38:27 +0100


On Friday 29 April 2005 13:43, Dave wrote:
> Seriously though, one of the things I like about the Shootout is that it is
> not focused on floating point, as so many benchmarks seem to be. Over the
> past year of so I've written alot of C/++ for 'high-performance' programs
> ('alot' and 'high-performance' are relative of course ;). I just grep'd
> that repository and it appears that the above ratio holds there as well.

Agreed.

> Another thing is that so often double precision floating point is the only
> thing measured.

You need to be very careful here. Programs, even benchmarks, rarely use 
nothing but floating point. Even my "floating point intensive" ray tracer 
spends 40% of its time doing other things (probably traversing data 
structures).

> And is perhaps over-used in production code as well.

And here. People often choose their precision carefully.

> For  
> one recent floating point intensive app. that I tuned, all I did was
> basically 'refactor' it to use SP instead of DP and the performance soared
> and mem. usage dropped.

I just altered my ray tracer to use single precision out of interest. It runs 
at _half the speed_ using single precision on AMD64! My uneducated guess is 
that this is a float alignment issue. However, I've tried reordering members 
and it makes no difference.

> All w/o a lick of difference to the end user 
> because the extra precision was not needed in this case. My point being,
> why are all of the floating point benchmarks I see out there (not just the
> Shootout) double precision when in reality single precision is (or should
> be) used in more day-to-day applications?

In the context of on-CPU computations, single precision is basically no faster 
than double precision on modern hardware. The distinction is only important 
as a storage format, to halve the memory footprint. This has been discussed 
at length on the caml-list because OCaml only supports double precision 
computation but supports both precisions for storage. That was a carefully 
chosen design decision.

One group of applications which make a lot of use of single precision are 
graphics applications (I'm thinking primarily of OpenGL here, but this also 
applies to the ray tracer). I do a lot of graphics work and, even there, I 
use double precision for all the high-level stuff as it is only marginally 
slower but much more numerically robust. I believe most OpenGL drivers use 
single precision internally.

> FP perf. is important, but I'd hate to see the Shootout focus a whole lot
> more on it.

Yes, I'd be happy if ~15% of the benchmarks were FP intensive. However, I'm 
happy to see 50% of the benchmarks use some FP, as long as they do more 
interesting things with it than just +, -, * and the occasional /.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists