Added inline to dims(), impacts performance greatly.

This commit is contained in:
Olek 2016-12-30 20:23:47 +01:00
parent 89428ed260
commit b85932fe64
2 changed files with 9 additions and 6 deletions

View File

@ -62,5 +62,5 @@ fn bench_adding_same_node_to_1000_tree(b: &mut Bencher) {
benchmark_group!(benches, /* bench_creating_1000_node_tree, */ bench_single_loop_times_for_1000_node_tree /*,bench_adding_same_node_to_1000_tree */);
benchmark_group!(benches, bench_creating_1000_node_tree, bench_single_loop_times_for_1000_node_tree,bench_adding_same_node_to_1000_tree);
benchmark_main!(benches);

View File

@ -16,6 +16,7 @@ impl Point3WithId {
}
impl KdtreePointTrait for Point3WithId {
#[inline]
fn dims(&self) -> &[f64] {
return &self.dims;
}
@ -37,6 +38,7 @@ impl Point2WithId {
}
impl KdtreePointTrait for Point2WithId {
#[inline]
fn dims(&self) -> &[f64] {
return &self.dims;
}
@ -58,6 +60,7 @@ impl Point1WithId {
}
impl KdtreePointTrait for Point1WithId {
#[inline]
fn dims(&self) -> &[f64] {
return &self.dims;
}