Skip to content

Commit e5fb4c6

Browse files
committed
bench: updated benchmarks
1 parent 3d1e86e commit e5fb4c6

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

benches/decode_point.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use criterion::{Criterion, black_box};
2+
use qbin::Cell;
3+
4+
const QBIN: u64 = 5246083350086549503;
5+
const GEOHASH: &str = "rbsm1hsuvshv";
6+
7+
pub fn bench(c: &mut Criterion) {
8+
let mut group = c.benchmark_group("decodePoint");
9+
10+
group.bench_function("geohash", |b| {
11+
let (index, _, _) = geohash::decode(GEOHASH).unwrap();
12+
b.iter(|| black_box(&index))
13+
});
14+
15+
group.bench_function("qbin", |b| {
16+
let index = Cell::new(QBIN).to_point();
17+
b.iter(|| black_box(&index))
18+
});
19+
20+
group.finish();
21+
}

benches/get_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn bench(c: &mut Criterion) {
1313
b.iter(|| black_box(index).resolution())
1414
});
1515
group.bench_function("qbin", |b| {
16-
let index = Cell::try_from(INPUT_QB).expect("cell index");
16+
let index = Cell::new(INPUT_QB);
1717
b.iter(|| black_box(index).resolution())
1818
});
1919

benches/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use criterion::{criterion_group, criterion_main};
22

3+
mod decode_point;
34
mod encode_point;
45
// mod get_cell_area;
56
mod get_resolution;
@@ -8,7 +9,8 @@ criterion_group!(
89
benches,
910
get_resolution::bench,
1011
// get_cell_area::bench,
11-
encode_point::bench
12+
encode_point::bench,
13+
decode_point::bench
1214
);
1315

1416
criterion_main!(benches);

cliff.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ commit_preprocessors = [
6262
commit_parsers = [
6363
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
6464
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
65-
{ message = "^doc", group = "<!-- 3 -->📚 Documentation", skip = true},
65+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
6666
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
67-
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor", skip = true},
67+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
6868
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
69-
{ message = "^test", group = "<!-- 6 -->🧪 Testing", skip = true},
70-
{ message = "^chore\\(release\\): prepare for", skip = true },
71-
{ message = "^chore\\(deps.*\\)", skip = true },
72-
{ message = "^chore\\(pr\\)", skip = true },
73-
{ message = "^chore\\(pull\\)", skip = true },
74-
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" , skip = true},
69+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
70+
{ message = "^chore\\(release\\): prepare for" },
71+
{ message = "^chore\\(deps.*\\)" },
72+
{ message = "^chore\\(pr\\)" },
73+
{ message = "^chore\\(pull\\)" },
74+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
7575
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
7676
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
7777
{ message = ".*", group = "<!-- 10 -->💼 Other" },

0 commit comments

Comments
 (0)