From ce73692f749178177556bb9398137642b6f99748 Mon Sep 17 00:00:00 2001 From: Leonhard Markert Date: Fri, 3 Apr 2020 13:39:34 +0200 Subject: [PATCH 1/2] Resurrect legacy benchmarks --- Benchmark/Makefile | 24 ------------------- {Benchmark => bench-legacy}/BinSearch.hs | 0 {Benchmark => bench-legacy}/SimpleRNGBench.hs | 4 ++-- random.cabal | 14 +++++++++++ 4 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 Benchmark/Makefile rename {Benchmark => bench-legacy}/BinSearch.hs (100%) rename {Benchmark => bench-legacy}/SimpleRNGBench.hs (98%) diff --git a/Benchmark/Makefile b/Benchmark/Makefile deleted file mode 100644 index 8a84e6479..000000000 --- a/Benchmark/Makefile +++ /dev/null @@ -1,24 +0,0 @@ - - -#OPTS= -O2 -Wall -XCPP -OPTS= -O2 -Wall -XCPP -Werror - -all: lib bench - -lib: - (cd .. && ghc $(OPTS) --make System/Random.hs) - -bench: - ghc $(OPTS) -i.. --make SimpleRNGBench.hs - -# When benchmarking against other packages installed via cabal it is -# necessary to IGNORE the System/Random.hs files in the current directory. -# (Otherwise instances of RandomGen are confused.) -bench2: - ghc $(OPTS) -DTEST_COMPETITORS --make SimpleRNGBench.hs - -clean: - rm -f *.o *.hi SimpleRNGBench -# cabal clean -# (cd Benchmark/ && rm -f *.o *.hi SimpleRNGBench) -# (cd System/ && rm -f *.o *.hi SimpleRNGBench) diff --git a/Benchmark/BinSearch.hs b/bench-legacy/BinSearch.hs similarity index 100% rename from Benchmark/BinSearch.hs rename to bench-legacy/BinSearch.hs diff --git a/Benchmark/SimpleRNGBench.hs b/bench-legacy/SimpleRNGBench.hs similarity index 98% rename from Benchmark/SimpleRNGBench.hs rename to bench-legacy/SimpleRNGBench.hs index c25b75d47..a2f919d7d 100644 --- a/Benchmark/SimpleRNGBench.hs +++ b/bench-legacy/SimpleRNGBench.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE BangPatterns, ScopedTypeVariables, ForeignFunctionInterface #-} +{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables, ForeignFunctionInterface #-} {-# OPTIONS_GHC -fwarn-unused-imports #-} -- | A simple script to do some very basic timing of the RNGs. @@ -44,7 +44,7 @@ import GHC.IO -- Miscellaneous helpers: -- Readable large integer printing: -commaint :: Integral a => a -> String +commaint :: Show a => a -> String commaint n = reverse $ concat $ intersperse "," $ diff --git a/random.cabal b/random.cabal index 06536bd75..9d5533e67 100644 --- a/random.cabal +++ b/random.cabal @@ -84,3 +84,17 @@ test-suite spec tasty -any, tasty-smallcheck -any, tasty-expected-failure -any + +benchmark legacy-bench + type: exitcode-stdio-1.0 + main-is: SimpleRNGBench.hs + hs-source-dirs: bench-legacy + other-modules: BinSearch + default-language: Haskell2010 + ghc-options: -Wall -O2 -threaded -rtsopts -with-rtsopts=-N + build-depends: + base -any, + random -any, + rdtsc -any, + split -any, + time -any From d34570b695905f530d4a546540299ae8a7a60285 Mon Sep 17 00:00:00 2001 From: Leonhard Markert Date: Fri, 3 Apr 2020 13:52:57 +0200 Subject: [PATCH 2/2] Fix Coveralls CI build --- stack-coveralls.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stack-coveralls.yaml b/stack-coveralls.yaml index 948886305..5575c2ffb 100644 --- a/stack-coveralls.yaml +++ b/stack-coveralls.yaml @@ -1,7 +1,8 @@ resolver: lts-14.27 packages: - . -extra-deps: [] +extra-deps: +- rdtsc-1.3.0.1@sha256:0a6e8dc715ba82ad72c7e2b1c2f468999559bec059d50540719a80b00dcc4e66,1557 flags: splitmix: random: false