Skip to content

Commit

Permalink
Elaborate documentation for nf
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim committed Mar 17, 2024
1 parent 85e8cb7 commit eb9aa0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Test/Tasty/Bench.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,10 @@ funcToBench frc = (Benchmarkable .) . funcToBenchLoop SPEC
-- on garbage collector. Also no list fusion will happen.
-- A better approach is 'nf' (@\\n@ @->@ 'sum' @[1..n]@) @1000000@.
--
-- It is preferable that the return type of the function under measurement
-- is inhabited enough to depend genuinely on all computations and is not simply @b ~ ()@.
-- Otherwise GHC might get aggressive and optimise the payload away.
--
-- If you are measuring an inlinable function,
-- it is prudent to ensure that its invocation is fully saturated,
-- otherwise inlining will not happen. That's why one can often
Expand Down

0 comments on commit eb9aa0e

Please sign in to comment.