tweag/hyperion

Name: hyperion

Owner: Tweag I/O

Description: A lab for future Criterion features.

Created: 2016-12-27 14:16:44.0

Updated: 2018-03-16 15:05:52.0

Pushed: 2018-01-08 08:09:14.0

Homepage:

Size: 104

Language: Haskell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Hyperion: Haskell-based systems benchmarking

Build Status

Hyperion is a DSL for writing benchmarks to measure and analyze software performance. It is a lab for future Criterion features.

Getting started
Build

You can build the micro benchmark example using stack:

ack build
ack exec hyperion-micro-benchmark-example
Example usage

The Hyperion DSL is a backwards compatible extension to Criterion's DSL (except for the rarely used env combinator, which has a safer type). Here is an example:

hmarks :: [Benchmark]
hmarks =
[ bench "id" (nf id ())
, series [0,5..20] $ \n ->
    bgroup "pure-functions"
      [ bench "fact" (nf fact n)
      , bench "fib" (nf fib n)
      ]
, series [1..4] $ \n ->
    series [1..n] $ \k ->
      bench "n choose k" $ nf (uncurry choose) (n, k)
]

 :: IO ()
 = defaultMain "hyperion-example-micro-benchmarks" benchmarks

By default Hyperion runs your benchmarks and pretty prints the results. There are several command-line options that you can pass to the executable, like printing the results to a JSON file or including individual raw measurements. To see the full set of options run the executable with --help:

ack exec hyperion-micro-benchmark-example -- --help
e: hyperion-micro-benchmark-example ([--pretty] | [-j|--json PATH] |
                                    [-f|--flat PATH]) ([-l|--list] | [--run]
                                    | [--no-analyze]) [--raw]
                                    [--arg KEY:VAL] [NAME...]

lable options:
,--help                Show this help text
pretty                 Pretty prints the measurements on stdout.
,--json PATH           Where to write the json benchmarks output. Can be a
                       file name, a directory name or '-' for stdout.
,--flat PATH           Where to write the json benchmarks output. Can be a
                       file name, a directory name or '-' for stdout.
version                Display version information
,--list                List benchmark names
run                    Run benchmarks and analyze them (default)
no-analyze             Only run the benchmarks
raw                    Include raw measurement data in report.
arg KEY:VAL            Extra metadata to include in the report, in the
                       format key:value.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.