@@ -11,26 +11,13 @@ using PicoTraits =
1111template <typename PointX>
1212using PicoKdTreeCtSldMid = pico_tree::KdTree<PicoTraits<PointX>>;
1313
14- template <typename PointX>
15- using PicoKdTreeCtLngMed = pico_tree::KdTree<
16- PicoTraits<PointX>,
17- pico_tree::L2Squared<PicoTraits<PointX>>,
18- pico_tree::SplitterLongestMedian<PicoTraits<PointX>>>;
19-
2014template <typename PointX>
2115using PicoKdTreeRtSldMid = pico_tree::KdTree<
2216 PicoTraits<PointX>,
2317 pico_tree::L2Squared<PicoTraits<PointX>>,
2418 pico_tree::SplitterSlidingMidpoint<PicoTraits<PointX>>,
2519 pico_tree::kDynamicDim >;
2620
27- template <typename PointX>
28- using PicoKdTreeRtLngMed = pico_tree::KdTree<
29- PicoTraits<PointX>,
30- pico_tree::L2Squared<PicoTraits<PointX>>,
31- pico_tree::SplitterLongestMedian<PicoTraits<PointX>>,
32- pico_tree::kDynamicDim >;
33-
3421class BmPicoKdTree : public pico_tree ::Benchmark {
3522 public:
3623};
@@ -47,14 +34,6 @@ BENCHMARK_DEFINE_F(BmPicoKdTree, BuildCtSldMid)(benchmark::State& state) {
4734 }
4835}
4936
50- BENCHMARK_DEFINE_F (BmPicoKdTree, BuildCtLngMed)(benchmark::State& state) {
51- int max_leaf_size = state.range (0 );
52-
53- for (auto _ : state) {
54- PicoKdTreeCtLngMed<PointX> tree (points_tree_, max_leaf_size);
55- }
56- }
57-
5837BENCHMARK_DEFINE_F (BmPicoKdTree, BuildRtSldMid)(benchmark::State& state) {
5938 int max_leaf_size = state.range (0 );
6039
@@ -63,32 +42,16 @@ BENCHMARK_DEFINE_F(BmPicoKdTree, BuildRtSldMid)(benchmark::State& state) {
6342 }
6443}
6544
66- BENCHMARK_DEFINE_F (BmPicoKdTree, BuildRtLngMed)(benchmark::State& state) {
67- int max_leaf_size = state.range (0 );
68-
69- for (auto _ : state) {
70- PicoKdTreeRtLngMed<PointX> tree (points_tree_, max_leaf_size);
71- }
72- }
73-
7445// Argument 1: Maximum leaf size.
7546BENCHMARK_REGISTER_F (BmPicoKdTree, BuildCtSldMid)
7647 ->Unit(benchmark::kMillisecond )
7748 ->Arg(1 )
7849 ->DenseRange(6 , 14 , 2 );
79- BENCHMARK_REGISTER_F (BmPicoKdTree, BuildCtLngMed)
80- ->Unit(benchmark::kMillisecond )
81- ->Arg(1 )
82- ->DenseRange(6 , 14 , 2 );
8350
8451BENCHMARK_REGISTER_F (BmPicoKdTree, BuildRtSldMid)
8552 ->Unit(benchmark::kMillisecond )
8653 ->Arg(1 )
8754 ->DenseRange(6 , 14 , 2 );
88- BENCHMARK_REGISTER_F (BmPicoKdTree, BuildRtLngMed)
89- ->Unit(benchmark::kMillisecond )
90- ->Arg(1 )
91- ->DenseRange(6 , 14 , 2 );
9255
9356// ****************************************************************************
9457// Knn
@@ -110,22 +73,6 @@ BENCHMARK_DEFINE_F(BmPicoKdTree, KnnCtSldMid)(benchmark::State& state) {
11073 }
11174}
11275
113- BENCHMARK_DEFINE_F (BmPicoKdTree, KnnCtLngMed)(benchmark::State& state) {
114- int max_leaf_size = state.range (0 );
115- int knn_count = state.range (1 );
116-
117- PicoKdTreeCtLngMed<PointX> tree (points_tree_, max_leaf_size);
118-
119- for (auto _ : state) {
120- std::vector<pico_tree::Neighbor<Index, Scalar>> results;
121- std::size_t sum = 0 ;
122- for (auto const & p : points_test_) {
123- tree.SearchKnn (p, knn_count, &results);
124- benchmark::DoNotOptimize (sum += results.size ());
125- }
126- }
127- }
128-
12976BENCHMARK_DEFINE_F (BmPicoKdTree, NnCtSldMid)(benchmark::State& state) {
13077 int max_leaf_size = state.range (0 );
13178
@@ -139,19 +86,6 @@ BENCHMARK_DEFINE_F(BmPicoKdTree, NnCtSldMid)(benchmark::State& state) {
13986 }
14087}
14188
142- BENCHMARK_DEFINE_F (BmPicoKdTree, NnCtLngMed)(benchmark::State& state) {
143- int max_leaf_size = state.range (0 );
144-
145- PicoKdTreeCtLngMed<PointX> tree (points_tree_, max_leaf_size);
146-
147- for (auto _ : state) {
148- pico_tree::Neighbor<Index, Scalar> result;
149- for (auto const & p : points_test_) {
150- tree.SearchNn (p, &result);
151- }
152- }
153- }
154-
15589BENCHMARK_REGISTER_F (BmPicoKdTree, KnnCtSldMid)
15690 ->Unit(benchmark::kMillisecond )
15791 ->Args({1 , 1 })
@@ -179,18 +113,6 @@ BENCHMARK_REGISTER_F(BmPicoKdTree, KnnCtSldMid)
179113 ->Args({12 , 12 })
180114 ->Args({14 , 12 });
181115
182- // For a single nn this method performs the fasted. Increasing the amount of nns
183- // will land it in between sliding midpoint and nanoflann, until it seems to
184- // become slower than both other methods.
185- BENCHMARK_REGISTER_F (BmPicoKdTree, KnnCtLngMed)
186- ->Unit(benchmark::kMillisecond )
187- ->Args({1 , 4 })
188- ->Args({6 , 4 })
189- ->Args({8 , 4 })
190- ->Args({10 , 4 })
191- ->Args({12 , 4 })
192- ->Args({14 , 4 });
193-
194116// The 2nd argument is used to keep plot_benchmarks.py the same.
195117BENCHMARK_REGISTER_F (BmPicoKdTree, NnCtSldMid)
196118 ->Unit(benchmark::kMillisecond )
@@ -201,16 +123,6 @@ BENCHMARK_REGISTER_F(BmPicoKdTree, NnCtSldMid)
201123 ->Args({12 , 1 })
202124 ->Args({14 , 1 });
203125
204- // The 2nd argument is used to keep plot_benchmarks.py the same.
205- BENCHMARK_REGISTER_F (BmPicoKdTree, NnCtLngMed)
206- ->Unit(benchmark::kMillisecond )
207- ->Args({1 , 1 })
208- ->Args({6 , 1 })
209- ->Args({8 , 1 })
210- ->Args({10 , 1 })
211- ->Args({12 , 1 })
212- ->Args({14 , 1 });
213-
214126// ****************************************************************************
215127// Radius
216128// ****************************************************************************
@@ -236,17 +148,17 @@ BENCHMARK_DEFINE_F(BmPicoKdTree, RadiusCtSldMid)(benchmark::State& state) {
236148// Argument 2: Search radius (divided by 10.0).
237149BENCHMARK_REGISTER_F (BmPicoKdTree, RadiusCtSldMid)
238150 ->Unit(benchmark::kMillisecond )
239- ->Args({1 , 2 })
240- ->Args({6 , 2 })
241- ->Args({8 , 2 })
242- ->Args({10 , 2 })
243- ->Args({12 , 2 })
244- ->Args({14 , 2 })
245- ->Args({1 , 4 })
246- ->Args({6 , 4 })
247- ->Args({8 , 4 })
248- ->Args({10 , 4 })
249- ->Args({12 , 4 })
250- ->Args({14 , 4 });
151+ ->Args({1 , 15 })
152+ ->Args({6 , 15 })
153+ ->Args({8 , 15 })
154+ ->Args({10 , 15 })
155+ ->Args({12 , 15 })
156+ ->Args({14 , 15 })
157+ ->Args({1 , 30 })
158+ ->Args({6 , 30 })
159+ ->Args({8 , 30 })
160+ ->Args({10 , 30 })
161+ ->Args({12 , 30 })
162+ ->Args({14 , 30 });
251163
252164BENCHMARK_MAIN ();
0 commit comments