https://github.com/vmchale/morphism-zoo
Some examples of recursion schemes, with benchmarks
https://github.com/vmchale/morphism-zoo
Last synced: 9 months ago
JSON representation
Some examples of recursion schemes, with benchmarks
- Host: GitHub
- URL: https://github.com/vmchale/morphism-zoo
- Owner: vmchale
- License: bsd-3-clause
- Created: 2017-05-24T01:08:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-08T01:21:06.000Z (over 8 years ago)
- Last Synced: 2025-04-04T07:51:13.196Z (9 months ago)
- Language: Haskell
- Size: 646 KB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# morphism-zoo
[](https://travis-ci.org/vmchale/morphism-zoo)
## Benchmarks
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](http://haskellstack.org). Then:
```bash
$ stack bench
```
or, if you'd like a particular version of ghc:
To benchmark only one target:
```bash
$ stack bench morphism-zoo:suffix-bench-long
```
### Conclusions
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](http://releases.llvm.org/download.html). Then:
```
stack bench morphism-zoo:suffix-bench
```
To benchmark the Rust:
```
cd rust
cargo bench
```
To benchmark the Python:
```
python python/python-suffix.py
```
To benchmark the Julia:
```
julia julia/init.jl
julia suffixes.jl
```