PyHaskell benchmark suite
PyHaskell is a (work in progress) Haskell implementation written in RPython. The PyHaskell VM is a backend for GHC, converting GHC's external Core into a JSON representation, which it then parses and evaluates.
This benchmark suite contain mostly micro-benchmarks that can be used on PyHaskell with the help of the runner.py Python module. See Benchmarks.
The bin/ folder has different versions of PyHaskell translated to C with the RPython translation toolchain from the PyPy project. Some of them contain the RPython meta-tracing just-in-time compiler. See PyHaskell versions.
Dependencies and installation
Download the following dependencies:
- PyPy source code
- PyHaskell source code
- Glasgow Haskell Compiler 7.4.2
- Python 2.7
- The LLVM Compiler Infrastructure (optional)
Install GHC and Python, and add PyPy and PyHaskell to PYTHONPATH env variable. LLVM is required for GHC's LLVM backend. The last two items, Haskell packages required by PyHaskell, can be installed with cabal.
The src/ folder contains the following benchmarks:
- addition - very simple interger addition
- fibonacci - the naive fibonacci implementation
The bin/ folder has different versions of PyHaskell translated to C. The following table list the different versions and their source repository revisions.
|PyHaskell version||PyHaskell revision||PyPy revision||Note|
- usage: runner.py [-h] [-t [TV]] [-n [NUM]] [-v] [-p] [-z] [-c]
- [target] [benchmark [benchmark ...]]
Run PyHaskell benchmarks.
- positional arguments:
- target target binary to benchmark benchmark a specific benchmark to run
- optional arguments:
-h, --help show this help message and exit
-t [TV], --tv [TV] PyHaskell target version -n [NUM], --num [NUM]
number of times to repeat benchmark
-v, --verbose print detailed information -p, --priority run benchmark at highest priority, require root -z, --zdecode create z-decoded hcr file of benchmark -c, --count count operations in jit trace-log
The runner report context switches and waits if the --verbose cli flag is given, and there are any context switches or waiting during benchmarking. The runner also set process priority to 99 if the --priority cli flag is given, which may require root.
PyHaskell-benchmarks are licensed under the MIT license. See separate LICENSE.txt.