26 lines
712 B
Rust
26 lines
712 B
Rust
#[path = "shared.rs"]
|
|
mod shared;
|
|
use std::hint::black_box;
|
|
|
|
use autobarts::spindex::RStarTree;
|
|
use criterion::{Criterion, criterion_group};
|
|
use shared::*;
|
|
|
|
fn bench_insert_bulk_rstartree_2d(_c: &mut Criterion) {
|
|
let points = generate_2d_data();
|
|
let mut cc = configure_criterion();
|
|
cc.bench_function("insert_bulk_2d_rstartree", |b| {
|
|
b.iter_with_setup(
|
|
|| {
|
|
let tree = RStarTree::new(BENCH_NODE_CAPACITY);
|
|
(tree, points.clone())
|
|
},
|
|
|(mut tree, points)| {
|
|
tree.insert_bulk(points);
|
|
black_box(());
|
|
},
|
|
)
|
|
});
|
|
}
|
|
|
|
criterion_group!(benches, bench_insert_bulk_rstartree_2d,);
|