Faster Array#/MutableArray# copies

Roman Leshchinskiy rl at cse.unsw.edu.au
Fri Feb 18 10:00:11 CET 2011


Johan Tibell wrote:
>
> * Could we use built-in compiler rules to catch array copies of known
> length and replace them with e.g. unrolled loops? My particular use case
> involves copying small arrays (size: 1-32). Ideally this should be as fast
> as copying a tuple of the corresponding size but I'm pretty sure we're far
> off that goal.

Out of idle curiousity, couldn't you use tuples instead of arrays?

FWIW, I agree that doing something cleverer than just calling memcpy could
be very worthwhile. As Max points out, you could perhaps try to do
something with the LLVM backend.

Roman






More information about the Glasgow-haskell-users mailing list