Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ build:ci --announce_rc
#build:linux --copt="-march=skylake"
#build:linux --copt="-march=haswell"
#build:linux --copt="-march=native"
#build:linux --copt="-fno-inline"
build:linux --copt="-fvisibility=hidden"
build:linux --copt="-fno-omit-frame-pointer" # for friendlier stack traces
build:linux --copt="-Wno-error"
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ More information about PH-Trees (including a Java implementation) is available [

* [Theory](#theory)

## License



----------------------------------

## API Usage
Expand Down Expand Up @@ -674,3 +678,15 @@ The PH-Tree is discussed in the following publications and reports:
- T. Zaeschke: "The PH-Tree Revisited", (2015)
- T. Zaeschke, M.C. Norrie: "Efficient Z-Ordered Traversal of Hypercube Indexes" (BTW 2017).

## License

<a id="license"></a>

The PH-tree is licensed under [Apache APL 2.0](LICENSE), except for code in
[include/phtree/aux](include/phtree/aux).

The code in [include/phtree/aux](include/phtree/aux) is based on code by
Malte Skarupke (Copyright 2020) and is licensed under the
[Boost Software License 1.0](https://www.boost.org/LICENSE_1_0.txt).


15 changes: 15 additions & 0 deletions benchmark/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,21 @@ cc_binary(
],
)

cc_binary(
name = "knn_mm_d_benchmark",
testonly = True,
srcs = [
"knn_mm_d_benchmark.cc",
],
linkstatic = True,
deps = [
":benchmark",
"//:phtree",
"@gbenchmark//:benchmark",
"@spdlog",
],
)

cc_binary(
name = "query_benchmark",
testonly = True,
Expand Down
21 changes: 19 additions & 2 deletions benchmark/bpt_insert_benchmark.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 Tilmann Zäschke
* Copyright 2022-2023 Tilmann Zäschke
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
#include "benchmark_util.h"
#include "logging.h"
#include "phtree/common/b_plus_tree_hash_map.h"
#include "phtree/common/b_plus_tree_heap.h"
#include "phtree/common/b_plus_tree_map.h"
#include "phtree/common/b_plus_tree_multimap.h"
#include <benchmark/benchmark.h>
Expand All @@ -30,6 +31,7 @@ const int GLOBAL_MAX = 10000;
enum Scenario {
MAP,
MULTIMAP,
MULTIMAP2,
HASH_MAP,
STD_MAP,
STD_MULTIMAP,
Expand Down Expand Up @@ -118,7 +120,22 @@ void IndexBenchmark<DIM, TYPE>::SetupWorld(benchmark::State& state) {
template <size_t DIM, Scenario TYPE>
void IndexBenchmark<DIM, TYPE>::Insert(benchmark::State& state, Index& tree) {
switch (TYPE) {
default: {
case MAP: {
for (size_t i = 0; i < num_entities_; ++i) {
tree.emplace(points_[i][0], (payload_t)i);
}
break;
}
case MULTIMAP:
case MULTIMAP2:
case STD_MULTIMAP: {
for (size_t i = 0; i < num_entities_; ++i) {
tree.emplace(points_[i][0], (payload_t)i);
}
break;
}
case HASH_MAP:
case STD_MAP: {
for (size_t i = 0; i < num_entities_; ++i) {
tree.emplace(points_[i][0], (payload_t)i);
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/hd_erase_d_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using payload_t = std::uint32_t;
template <dimension_t DIM>
class IndexBenchmark {
public:
IndexBenchmark(benchmark::State& state);
explicit IndexBenchmark(benchmark::State& state);
void Benchmark(benchmark::State& state);

private:
Expand Down
12 changes: 12 additions & 0 deletions benchmark/knn_d_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ BENCHMARK_CAPTURE(PhTree3D, KNN_CU_10_of_10K, TestGenerator::CUBE, 10000, 10)
BENCHMARK_CAPTURE(PhTree3D, KNN_CU_10_of_1M, TestGenerator::CUBE, 1000000, 10)
->Unit(benchmark::kMillisecond);

BENCHMARK_CAPTURE(PhTree3D, KNN_CU_100_of_10K, TestGenerator::CUBE, 10000, 100)
->Unit(benchmark::kMillisecond);

BENCHMARK_CAPTURE(PhTree3D, KNN_CU_100_of_1M, TestGenerator::CUBE, 1000000, 100)
->Unit(benchmark::kMillisecond);

// index type, scenario name, data_type, num_entities, query_result_size
// PhTree 3D CLUSTER
BENCHMARK_CAPTURE(PhTree3D, KNN_CL_1_of_10K, TestGenerator::CLUSTER, 10000, 1)
Expand All @@ -154,4 +160,10 @@ BENCHMARK_CAPTURE(PhTree3D, KNN_CL_10_of_10K, TestGenerator::CLUSTER, 10000, 10)
BENCHMARK_CAPTURE(PhTree3D, KNN_CL_10_of_1M, TestGenerator::CLUSTER, 1000000, 10)
->Unit(benchmark::kMillisecond);

BENCHMARK_CAPTURE(PhTree3D, KNN_CL_100_of_10K, TestGenerator::CLUSTER, 10000, 100)
->Unit(benchmark::kMillisecond);

BENCHMARK_CAPTURE(PhTree3D, KNN_CL_100_of_1M, TestGenerator::CLUSTER, 1000000, 100)
->Unit(benchmark::kMillisecond);

BENCHMARK_MAIN();
Loading