mirror of
https://github.com/Bodigrim/tasty-bench.git
synced 2024-09-11 16:56:14 +03:00
Recommend switching to non-moving garbage collector
This commit is contained in:
parent
6d0e0b107a
commit
291c6b7659
@ -78,8 +78,11 @@ synopsis: Example of a benchmark
|
||||
benchmark bench-fibo
|
||||
main-is: BenchFibo.hs
|
||||
type: exitcode-stdio-1.0
|
||||
ghc-options: "-with-rtsopts=-A32m"
|
||||
build-depends: base, tasty-bench
|
||||
if impl(ghc >= 8.10)
|
||||
ghc-options: "-with-rtsopts=-A32m --nonmoving-gc"
|
||||
else
|
||||
ghc-options: "-with-rtsopts=-A32m"
|
||||
```
|
||||
|
||||
And here is `BenchFibo.hs`:
|
||||
@ -290,6 +293,9 @@ look for another way to speed up generation of Fibonacci numbers.
|
||||
Alternatively bake it into
|
||||
`cabal` file as `ghc-options: "-with-rtsopts=-A32m"`.
|
||||
|
||||
For GHC >= 8.10 consider switching benchmarks to a non-moving garbage collector,
|
||||
because it decreases GC pauses and corresponding noise: `+RTS --nonmoving-gc`.
|
||||
|
||||
* If benchmark results look malformed like below, make sure that you are
|
||||
invoking `Test.Tasty.Bench.defaultMain` and not `Test.Tasty.defaultMain`
|
||||
(the difference is `consoleBenchReporter` vs. `consoleTestReporter`):
|
||||
|
@ -65,8 +65,11 @@ Benchmarks are declared in a separate section of @cabal@ file:
|
||||
> benchmark bench-fibo
|
||||
> main-is: BenchFibo.hs
|
||||
> type: exitcode-stdio-1.0
|
||||
> ghc-options: "-with-rtsopts=-A32m"
|
||||
> build-depends: base, tasty-bench
|
||||
> if impl(ghc >= 8.10)
|
||||
> ghc-options: "-with-rtsopts=-A32m --nonmoving-gc"
|
||||
> else
|
||||
> ghc-options: "-with-rtsopts=-A32m"
|
||||
|
||||
And here is @BenchFibo.hs@:
|
||||
|
||||
@ -261,6 +264,9 @@ another way to speed up generation of Fibonacci numbers.
|
||||
@stack@ @bench@ @--ba@ @\'+RTS@ @-A32m\'@. Alternatively bake it into @cabal@
|
||||
file as @ghc-options:@ @\"-with-rtsopts=-A32m\"@.
|
||||
|
||||
For GHC >= 8.10 consider switching benchmarks to a non-moving garbage collector,
|
||||
because it decreases GC pauses and corresponding noise: @+RTS@ @--nonmoving-gc@.
|
||||
|
||||
- If benchmark results look malformed like below, make sure that you
|
||||
are invoking 'Test.Tasty.Bench.defaultMain' and not
|
||||
'Test.Tasty.defaultMain' (the difference is 'consoleBenchReporter'
|
||||
|
Loading…
Reference in New Issue
Block a user