Operations on arrays

Martin Wierich martinw@cs.kun.nl
Fri, 05 Mar 1999 09:34:06 +0100


Hi everybody,

"Richard A. O'Keefe" wrote:

> There's an interesting lesson here.
> I started with straightforward code where I had concentrated on clarity.
> The kind of code that one hopes one's students will learn to write.
> I've ended up with something that is A FACTOR OF TWENTY-THREE TIMES
> FASTER by
>

...

>  - switching from lists of numbers to unboxed arrays (factor of 5)
>
> This is not good news.  What it really means in practice is that
> clear straightforward code can _easily_ be a factor of twenty or
> better _slower_ than hacked code.

I guess, it would be useful, if Clean had as a standard "unboxed" lists
([#Real]) and/or strict lists (strict in spine and element). A clever
implementation of these lists could probably be similar like the
implementation of arrays, especially when such lists are unique.

Martin Wierich