-- Benchmark compact against compactWithSharing. e.g.
--   ./compact_bench 1000000

main = do
  [n] <- map read <$> getArgs
  let m = Map.fromList [(x,[x*1000..x*1000+10]) | x <- [1..(n::Integer)]]
  evaluate (force m)
  timeIt "compact" $ compact m >>= compactSize >>= print
  timeIt "compactWithSharing" $ compactWithSharing m >>= compactSize >>= print
main = do
  [n] <- map read <$> getArgs
  let m = Map.fromList [(x,[x*1000..x*1000+10]) | x <- [1..(n::Integer)]]
  evaluate (force m)
  timeIt "compact" $ compact m >>= compactSize >>= print
  timeIt "compactWithSharing" $ compactWithSharing m >>= compactSize >>= print
main = do
  [n] <- map read <$> getArgs
  let m = Map.fromList [(x,[x*1000..x*1000+10]) | x <- [1..(n::Integer)]]
  evaluate (force m)
  timeIt "compact" $ compact m >>= compactSize >>= print
  timeIt "compactWithSharing" $ compactWithSharing m >>= compactSize >>= print