[Haskell-cafe] Vector sort poor performance

Felipe Lessa felipe.lessa at gmail.com
Thu Aug 21 05:00:55 UTC 2014


On 20-08-2014 21:24, Alexander Pakhomov wrote:
>     ref <- newIORef 0
>     forM_ [0..100000] $! \i -> do
>         modifyIORef' ref (+(foo $ fromInteger i)) -- for foo not to optimize out
>     readIORef ref >>= print
> 
> ghc -O2 sort.hs && time ./sort 

My first recommendation is to use criterion.  It will get you a way
better idea of the timing needed for your function, specially since it
does not do much work.

Cheers,

-- 
Felipe.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140821/ce6590b1/attachment.sig>


More information about the Haskell-Cafe mailing list