benchmarx

This commit is contained in:
jesopo 2023-03-21 22:17:05 +00:00
parent b484a0834e
commit f262cbc463
2 changed files with 20 additions and 0 deletions

View File

@ -6,3 +6,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
[dev-dependencies]
criterion = "0.4.0"
[[bench]]
name = "basic"
harness = false

13
benches/basic.rs Normal file
View File

@ -0,0 +1,13 @@
use criterion::{criterion_group, criterion_main, Criterion};
use irctokens::tokenise;
fn basic() {
tokenise(b"@tag1=tag1value;tag2=;tag3 :source COMMAND arg1 arg2 :arg3 with space").unwrap();
}
fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("basic", |b| b.iter(basic));
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);