Opened 7 years ago

Closed 2 years ago

#1589 closed proposed-project (fixed)

Benchmarking support for Cabal

Reported by: Johan Tibell Owned by:
Priority: good Keywords:
Cc: Difficulty: unknown
Mentor: not-accepted Topic: Cabal

Description

If you want to use e.g. Criterion to write benchmarks for your library you'll need to maintain a separate Makefile for building and running your benchmarks and thereby duplicate lots of the work that Cabal already does.

Task: Implement cabal benchmark, modelled after cabal test. Add a new benchmark stanza to Cabal e.g.

name: mylib
...

benchmark my-benchmark
  hs-source-dirs: benchmarks
  main-is: Benchmarks.hs
  type: stdio-1.0

  build-depends:
    base,
    Criterion,
    mylib

Use a similar API split that we have for testing. The basic type of benchmark is just a simple executable that can be built and run. Results are output to stdout.

The detailed interface would allow Cabal to see results of individual benchmarks and output these to e.g. a CSV file for later plotting/comparing.

Change History (1)

comment:1 Changed 2 years ago by Matthew Pickering

Resolution: fixed
Status: newclosed

Resolved with cabal bench

Note: See TracTickets for help on using tickets.