mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-01-24 19:35:57 +00:00
add readme
This commit is contained in:
parent
4b93dbec4c
commit
04e1f10d35
1 changed files with 44 additions and 1 deletions
|
@ -1 +1,44 @@
|
|||
# TODO
|
||||
# Benches
|
||||
This directory contains 3 sub-directories:
|
||||
|
||||
| Sub-directory | Purpose |
|
||||
|---------------|---------|
|
||||
| `micro/` | Micro-benchmarks for crates (e.g. timings for a single function)
|
||||
| `macro/` | Macro-benchmarks for whole crates or sub-systems (using Cuprate's custom benchmarking harness)
|
||||
| `harness/` | Cuprate's custom benchmarking harness
|
||||
|
||||
## Harness
|
||||
The harness is just another crate (that happens to be for benchmarking).
|
||||
|
||||
Conceptually, it's purpose is very simple:
|
||||
1. Set-up the benchmark
|
||||
1. Start timer
|
||||
1. Run benchmark
|
||||
1. Output data
|
||||
|
||||
This single harness runs the benchmarks found in `macro/`.
|
||||
|
||||
The way benchmarks "plug-in" to the harness is simply by implementing `trait Benchmark`.
|
||||
|
||||
See `cuprate-harness`' crate documentation for a user-guide:
|
||||
```bash
|
||||
cargo doc --open --package cuprate-harness
|
||||
```
|
||||
|
||||
## Macro
|
||||
Each sub-directory in here is a crate that plugs into the harness.
|
||||
|
||||
Benchmarks in `macro/` are for testing sub-systems and/or sections of a sub-system, e.g. the block downloader, the RPC server, the database, etc.
|
||||
|
||||
<!-- TODO -->
|
||||
See `macro/cuprate-database` for an example.
|
||||
<!-- TODO -->
|
||||
|
||||
## Micro
|
||||
Each sub-directory in here is a crate that uses [Criterion](https://bheisler.github.io/criterion.rs/book) for timing single functions, groups of functions.
|
||||
|
||||
They are generally be small in scope.
|
||||
|
||||
<!-- TODO -->
|
||||
See `macro/cuprate-json-rpc` for an example.
|
||||
<!-- TODO -->
|
Loading…
Reference in a new issue