[Haskell-cafe] memory issues

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Feb 27 18:34:14 EST 2009


Hello Don,

Saturday, February 28, 2009, 2:18:37 AM, you wrote:

>     offset :: !Integer

oh yes

> And possibly just using {-# UNPACK #-}!Int64 would be ok?

i think that it will be even better but main problem is a
huge unevaluated thunks. as the last hope, this may be converted to

x <- getOffsets
y <- getSizes x
z <- sort y

also, "zipWith (Block) offsets sizes" and getSizes may be combined to
make only one pass through data (although it's not highly important
since sort anyway will need them all). really good technique would be
to use some sort of heap to hold only 10-100 largest page sizes

btw,

data Block = Block {
      size::Integer
    , offset::Integer
    } deriving (Ord)

allows to omit instance Ord Block definition


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list