Add separate benchmarks for seq and par versions of verify_slice
This commit is contained in:
parent
1c2e0af69b
commit
69f70cfe72
25
README.md
25
README.md
|
@ -8,10 +8,15 @@ An implementation of Loom's Proof-of-History.
|
||||||
|
|
||||||
# Developing
|
# Developing
|
||||||
|
|
||||||
Install Rust and Cargo:
|
Building
|
||||||
|
---
|
||||||
|
|
||||||
|
Install rustc, cargo and rustfmt:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ curl https://sh.rustup.rs -sSf | sh
|
$ curl https://sh.rustup.rs -sSf | sh
|
||||||
|
$ source $HOME/.cargo/env
|
||||||
|
$ rustup component add rustfmt-preview
|
||||||
```
|
```
|
||||||
|
|
||||||
Download the source code:
|
Download the source code:
|
||||||
|
@ -21,8 +26,26 @@ $ git clone https://github.com/garious/phist.git
|
||||||
$ cd phist
|
$ cd phist
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Testing
|
||||||
|
---
|
||||||
|
|
||||||
Run the test suite:
|
Run the test suite:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo test
|
cargo test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Benchmarking
|
||||||
|
---
|
||||||
|
|
||||||
|
First install the nightly build of rustc. `cargo bench` requires unstable features:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ rustup install nightly
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the benchmarks:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cargo +nightly bench --features="unstable"
|
||||||
|
```
|
||||||
|
|
|
@ -133,6 +133,15 @@ mod bench {
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn event_bench(bencher: &mut Bencher) {
|
fn event_bench(bencher: &mut Bencher) {
|
||||||
|
let start_hash = 0;
|
||||||
|
let events = event::create_ticks(start_hash, 100_000, 8);
|
||||||
|
bencher.iter(|| {
|
||||||
|
assert!(event::verify_slice(&events, start_hash));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[bench]
|
||||||
|
fn event_bench_seq(bencher: &mut Bencher) {
|
||||||
let start_hash = 0;
|
let start_hash = 0;
|
||||||
let events = event::create_ticks(start_hash, 100_000, 8);
|
let events = event::create_ticks(start_hash, 100_000, 8);
|
||||||
bencher.iter(|| {
|
bencher.iter(|| {
|
||||||
|
|
Loading…
Reference in New Issue