Skip to content

Commit b2e1a26

Browse files
committed
Removed Longest Median benchmarks. Updated benchmark radii.
1 parent f25fc5b commit b2e1a26

File tree

2 files changed

+24
-112
lines changed

2 files changed

+24
-112
lines changed

examples/benchmark/bm_nanoflann.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ BENCHMARK_DEFINE_F(BmNanoflann, RadiusCt)(benchmark::State& state) {
144144
// Argument 2: Search radius (divided by 10.0).
145145
BENCHMARK_REGISTER_F(BmNanoflann, RadiusCt)
146146
->Unit(benchmark::kMillisecond)
147-
->Args({1, 2})
148-
->Args({6, 2})
149-
->Args({8, 2})
150-
->Args({10, 2})
151-
->Args({12, 2})
152-
->Args({14, 2})
153-
->Args({1, 4})
154-
->Args({6, 4})
155-
->Args({8, 4})
156-
->Args({10, 4})
157-
->Args({12, 4})
158-
->Args({14, 4});
147+
->Args({1, 15})
148+
->Args({6, 15})
149+
->Args({8, 15})
150+
->Args({10, 15})
151+
->Args({12, 15})
152+
->Args({14, 15})
153+
->Args({1, 30})
154+
->Args({6, 30})
155+
->Args({8, 30})
156+
->Args({10, 30})
157+
->Args({12, 30})
158+
->Args({14, 30});
159159

160160
BENCHMARK_MAIN();

examples/benchmark/bm_pico_kd_tree.cpp

Lines changed: 12 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,13 @@ using PicoTraits =
1111
template <typename PointX>
1212
using 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-
2014
template <typename PointX>
2115
using 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-
3421
class 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-
5837
BENCHMARK_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.
7546
BENCHMARK_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

8451
BENCHMARK_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-
12976
BENCHMARK_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-
15589
BENCHMARK_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.
195117
BENCHMARK_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).
237149
BENCHMARK_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

252164
BENCHMARK_MAIN();

0 commit comments

Comments
 (0)