1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00
semantic/vendor
Patrick Thomson ac543651ee Add NFData instances to enable more accurate benchmarking.
Because we're getting serious about benchmarking in the run-up to
Windrose, it's time to bring in the `deepseq` package to ensure that
benchmarks can fully evaluate the result of a test case.

The `deepseq` package provides an `NFData` typeclass:

```
class NFData a where
  rnf :: a -> ()
```

Instances use the `seq` combinator to ensure that the argument to
`rnf` is fully evaluated, returning (). If there is a `Generic`
instance for `a`, the implementation can be omitted. This patch adds
NFData for every syntax node, graph vertex, environment data
structures, and exceptions. It is long, but the work is very
straightforward, so don't panick.

The benchmark suite (`stack bench`) now produces more accurate
results. The benchmarks previously mimicked `rnf` by calling `show` on
the result of an evaluation or graph construction; now that we have
actual `NFData` instances we can use the `nfIO` combinator from
criterion. This has sped up the evaluation benchmarks and reduced
their memory consumption, while it has slowed down the call graph
benchmarks, as those benchmarks weren't evaluating the whole of the
graph.

Unfortunately, this patch increases compile times, as we have to
derive a few more Generic instances. I wish this weren't the case, but
there's little we can do about it now. In the future I have some plans
for how to reduce compile time, and I bet that those gains will at
least nullify the speed hit from this patch.

Now that we have NFData instances for every data type, we can start
benchmarking assignments, in preparation for fixing #2205.

This patch also pulls in updates to `effects` and `fastsum` that add
appropriate NFData instances for the data they vend.
2018-10-17 14:08:47 -04:00
..
effects@9616e462c5 Add NFData instances to enable more accurate benchmarking. 2018-10-17 14:08:47 -04:00
fastsum@487fedfb6e Add NFData instances to enable more accurate benchmarking. 2018-10-17 14:08:47 -04:00
freer-cofreer@6d94484a08 Build --profile builds in a separate stack-work directory. 2018-06-25 15:34:20 -04:00
haskell-tree-sitter@9c28ccf49b Fix crash/race associated with bracket (#2207) 2018-10-16 17:05:29 -04:00
hspec-expectations-pretty-diff@94af5871c2 Bump bump. 2017-05-11 14:55:17 -04:00
semilattices@cad77016f5 Add semilattices as a submodule. 2018-06-15 11:36:58 -04:00