Benchmarking
Purescript has a few benchmarking libraries:
Name | Status | Comments |
---|---|---|
purescript-benchotron (my fork) | Up-to-date | Uses QuickCheck Output results only in Node Results are viewable only via graphs |
purescript-benchotron (original) | Up-to-date | Uses QuickCheck Output results only in Node Results are viewable only via graphs |
purescript-minibench | Up-to-date | Provides quick estimates but not very accurate benchmarks |
purescript-benchmark | Outdated (PS 0.11.7 ) | Doesn't require QuickCheck Outputs results in Node and Browser Output is full ASCII table with percentage values |
In this folder, we'll be covering benchotron
because it works for 0.15.x
and has finer accuracy than minibench
and includes graphs.
This benchotron graph...
... was the result of this somewhat unreadable output
Compilation Instructions
Benchotron
is a Purescript library that provides bindings to Benchmark.js
. Follow these commands to set up this folder:
- Install
Benchmark.js
locally via the command below:
# Note: This must be installed locally for the code to work.
# If you install it globally, Node won't be able to find `benchmark`.
npm install benchmark
- Use
spago
to build the program::
# 'spago build' includes a call to 'spago install'
spago build
You can now use benchotron
via spago.
Generating benchmark results
- Run the below command
# Since we have `"benchmark/**/*.purs"` included in
# the `spago.dhall` file's "sources" config, we can use
# the below command instead. If you don't that that,
# you'll need to add '-p "benchmark/**/*.purs"' as an argument below.
spago run -m Benchmarking.Syntax.Benchotron
- It will output a file in the freshly-created
tmp
directory - Upload the outputted file to the Benchotron SVG Renderer
- Download the graph as an SVG or PNG