https://github.com/riot-ml/scarab
Benchmarking framework for OCaml
https://github.com/riot-ml/scarab
Last synced: 3 months ago
JSON representation
Benchmarking framework for OCaml
- Host: GitHub
- URL: https://github.com/riot-ml/scarab
- Owner: riot-ml
- Created: 2023-08-25T19:09:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T18:03:15.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T20:44:57.714Z (5 months ago)
- Language: OCaml
- Homepage:
- Size: 671 KB
- Stars: 26
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scarab 🪲
A microbenchmarking framework for Riot inspired by Elixir's [benchee][benchee]
and Rust's [criterion-rs][criterion].[benchee]: https://github.com/bencheeorg/benchee
[criterion]: https://github.com/bheisler/criterion.rs
## Getting Started
```
opam pin riot git+https://github.com/leostera/riot
opam pin scarab git+https://github.com/leostera/scarab
```And you can now create executables that use `scarab` as a library:
```
(executable
(name my_bench)
(libraries scarab))
```Here's an example benchmark:
```ocaml
Scarab.run ~name:"sums"
[
("sum 1", fun () -> sum 1);
("sum 100", fun () -> sum 100);
("sum 1_000", fun () -> sum 1_000);
("sum 2_000", fun () -> sum 2_000);
("sum 5_000", fun () -> sum 5_000);
("sum 10_000", fun () -> sum 10_000);
("sum 100_000", fun () -> sum 100_000);
]
```