Skip to content

Add deepseq on the input for nf and whnf #227

Description

@nikita-volkov

This is to ensure that the input evaluation is not involved in the execution of the benchmark.

Here is the patch that I'm suggesting:

-nf :: NFData b => (a -> b) -> a -> Benchmarkable
-nf f x = toBenchmarkable (nf' rnf f x)
+nf :: (NFData a, NFData b) => (a -> b) -> a -> Benchmarkable
+nf f x = deepseq x (toBenchmarkable (nf' rnf f x))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions