benchmarks for some recursion schemes



Build Status


This repository is for examples of recursion schemes, and benchmarks to compare them to other methods you might consider. You can find the results in the results directory.

Running the Benchmarks

Simply clone this repo and install stack. Then:

 $ stack bench

or, if you'd like a particular version of ghc:

To benchmark only one target:

 $ stack bench morphism-zoo:suffix-bench-long


Recursion schemes are faster sometimes, and pattern matching is faster other times. Hylomorphisms vs. paramorphisms will make a difference too. Benchmark it if you're curious!

Suffix Benchmarks

To run the suffix benchmarks for Haskell, install llvm 3.9. Then:

stack bench morphism-zoo:suffix-bench

To benchmark the Rust:

cd rust
cargo bench

To benchmark the Python:

python python/

To benchmark the Julia:

julia julia/init.jl
julia suffixes.jl