Skip to content

Very low throughput #51

@nh2

Description

@nh2
main = do
  let rs :: [Word8]
      rs = randoms (mkStdGen 42)

  print $ sum $ map (\x -> fromIntegral x :: Int) $ take 10000000 rs

gives me around 5 MB/s on my laptop.

main = do
  let rs :: [Int]
      rs = randoms (mkStdGen 42)

  print $ sum $ map (\x -> fromIntegral x :: Int) $ take 10000000 rs

gives me around 8 MB/s on my laptop.

This is very slow for a pseudorandom number generator.

/dev/urandom gives me 230 MB on the same machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions