Skip to content

Commit

Permalink
Benchmark and performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
idontgetoutmuch committed May 6, 2024
1 parent 584121f commit 7e4d898
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bench/Benchmark.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ main = do
, [ bench ("poisson " ++ show l) $ nfIO (genFromTable (tablePoisson l) mwc :: IO Int)
| l <- [0.01, 0.2, 0.8, 1.3, 2.4, 8, 12, 100, 1000]
]
, [ bench ("binomial " ++ show p ++ " " ++ show n) $ nfIO (liftM sum $ replicateM 1 $ genFromTable (tableBinomial n p) mwc :: IO Int)
, [ bench ("binomial " ++ show p ++ " " ++ show n) $ nfIO (liftM sum $ replicateM 100000 $ genFromTable (tableBinomial n p) mwc :: IO Int)
| (n,p) <- [ (4, 0.5), (10,0.1), (10,0.6), (10, 0.8), (100,0.4), (1400, 0.4)]
]
, [ bench ("binomiak " ++ show p ++ " " ++ show n) $ nfIO (liftM sum $ replicateM 1 $ binomial n p mwc :: IO Int)
, [ bench ("binomiak " ++ show p ++ " " ++ show n) $ nfIO (liftM sum $ replicateM 100000 $ binomial n p mwc :: IO Int)
| (n,p) <- [ (4, 0.5), (10,0.1), (10,0.6), (10, 0.8), (100,0.4), (1400, 0.4)]
]
]
Expand Down
3 changes: 1 addition & 2 deletions mwc-random.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0
build-type: Simple
name: mwc-random
version: 0.15.0.2
version: 0.15.0.3
license: BSD-2-Clause
license-file: LICENSE
copyright: 2009, 2010, 2011 Bryan O'Sullivan
Expand All @@ -12,7 +12,6 @@ homepage: https://github.com/haskell/mwc-random
bug-reports: https://github.com/haskell/mwc-random/issues

category: Math, Statistics
version: 0.15.0.3
synopsis: Fast, high quality pseudo random number generation
description:
This package contains code for generating high quality random
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let
pkgs = nixpkgs;

haskellDeps = ps: with ps; [
base doctest gauge math-functions mersenne-random mwc-random primitive random tasty-hunit tasty-quickcheck vector
base doctest gauge math-functions mersenne-random mwc-random primitive random tasty-bench tasty-hunit tasty-quickcheck vector
];

in
Expand Down

0 comments on commit 7e4d898

Please sign in to comment.