https://github.com/fuuzetsu/vector-sum-benchmarks
Microbenchmarks for element-wise addition of vectors
https://github.com/fuuzetsu/vector-sum-benchmarks
Last synced: 11 months ago
JSON representation
Microbenchmarks for element-wise addition of vectors
- Host: GitHub
- URL: https://github.com/fuuzetsu/vector-sum-benchmarks
- Owner: Fuuzetsu
- License: bsd-3-clause
- Created: 2018-03-04T19:39:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-04T22:23:26.000Z (almost 8 years ago)
- Last Synced: 2025-03-24T08:57:37.388Z (11 months ago)
- Language: Haskell
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# vector-sum-benchmarks
This package holds micro-benchmarks for various implementations of a
basic function `vsum :: Vector v Double => NonEmpty (v Double) -> v
Double` which adds elements of vectors elements-wise.
The idea is to provide multiple possible implementations for this
function and check which one performs the best for some use-cases.
To define new implementation, simply add a module in
`src/Benchmarking/VectorSum`. Remember to add your implementation in
tests (so that we can check it's consistent with others) and
benchmarks, both of which should be a couple of lines addition.
Benchmarks are ran for all three immutable vector types defined in the
`vector` package, for various input sizes. Note that it will take a
fairly long time to run default benchmarks for every defined size. I'd
recommend picking a size you want instead with an argument to
criterion:
```bash
stack bench vector-sum-benchmarks:bench:vector-sum-benchmarks-bench
--benchmark-arguments='-m pattern 1000000x1'
```
Allocation numbers run fairly quickly so that benchmark should work
out of the box without tweaking.