On 25-Nov-1998, Jan Skibinski <[EMAIL PROTECTED]> wrote:
>
> Thank you and all the others that responded to my
> question about "Reduction count as efficiency measure".
> I understand and accept the points that have been made
> about uselessness of Hugs statistics given as
> the reduction count or the timing.
...
> But there were few threads in this discussion that
> really worry me.
...
> 3. It has been suggested to me by several people that I
> should run my benchmarks in my final target environment,
> not in Hugs. Frankly, I really do not understand it.
> Suddenly, a portability is not important here?
No, portability is still important.
But you need to choose your portability targets carefully.
Even for library code, you can reasonably assume that
if the users of that library code care about efficiency
then they will compile the code with an optimizing compiler.
This means that making decisions on the basis of timings with
a non-optimizing compiler may not be such a good idea.
Certainly your code should be portable to all implementations,
but there may not be much advantage in trying to make it
efficient even on non-optimizing implementations.
> 4. Putting aside non-portable ByteArrays, one of such
> choices is Array vs. List vs. RandomAccessList.
> For algorithms based on scalar products my guess
> was that List would be the best choice. Chris
> confirmed it. Someone else suggested otherwise
> pointing out that Arrays are supposedly optimized
> specifically for numerical applications. Sorry,
> but I do not see why they should fare better
> for algorithms that avoid indexing. As I understand,
> Haskell Arrays are based on associative lists
> and their lookups cannot be possibly faster than well
> optimized 'head' and 'tail' operations on standard
> lists.
I think your understanding is gravely mistaken.
The intent, I believe, is that Haskell Arrays should be
implemented as contiguous memory, at least for optimizing compilers.
Implementations using association lists would IMHO only be
suitable only for non-optimizing compilers.
--
Fergus Henderson <[EMAIL PROTECTED]> | "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh> | but source code lives forever"
PGP: finger [EMAIL PROTECTED] | -- leaked Microsoft memo.