[Shootout-list] Rule 30

Jon Harrop jon@ffconsultancy.com
Thu, 19 May 2005 23:37:51 +0100


On Thursday 19 May 2005 20:44, Robert Seeger wrote:
> On 5/19/05, Jon Harrop <jon@ffconsultancy.com> wrote:
> > We're trying to measure how long it took to compute.
>
> True... However, I think the point is that actually doing the computation
> can be a condition of the test.

No it can't. That condition cannot be enforced in practice for many languages 
in the shootout. This is precisely why Haskell programmers have trouble with 
poorly designed benchmarks.

> Just because it CAN be precomputed doesn't mean it HAS to be.

Yes, precisely.

Some implementations may precompute it without the reader's knowledge. More 
worryingly, some language implementations may precompute it without the 
author's knowledge. This helps nobody as, in real life, we don't spend a lot 
of time executing programs to repeatedly compute the same constant.

Skaller's idea of designing tasks which require a suitably large number of 
possible inputs to practically obviate precomputation is the ideal solution. 
As I have said, this does not require much data to be loaded. Computing the 
center bit after n iterations of Wolfram's rule 30 from a given seed is an 
ideal example of this, IMHO.

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