[Haskell-cafe] memory-efficient data type for Netflix data -
UArray Int Int vs UArray Int Word8
Manlio Perillo
manlio_perillo at libero.it
Thu Feb 26 07:00:55 EST 2009
Kenneth Hoste ha scritto:
> Hello,
>
> I'm having a go at the Netflix Prize using Haskell. Yes, I'm brave.
>
> [...]
> To see if I could efficiently represent the data set in this way, I
> wrote a small
> Haskell program (attached) which uses the following data type:
>
From what I see, to append a new integer to the Array, you convert the
array to a list, append the new element to the list, and then convert to
array again.
Isn't this a bit inefficient?
The uvector package implements a vector of unboxed types, and has an
snocU operation, to append an element to the array.
I don't know how efficient it is, however.
By the way, about uvector: it has a Stream data type, and you can build
a vector from a stream.
But how this work and how (if any) the stream data is integrated with
other packages?
The package documentations seems to be still incomplete.
> [...]
Regards Manlio Perillo
More information about the Haskell-Cafe
mailing list