Skip to content

Commit b32cd09

Browse files
authored
Merge branch 'master' into fix_parameter
2 parents 6a7c3cf + 84c1966 commit b32cd09

File tree

359 files changed

+14219
-3122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

359 files changed

+14219
-3122
lines changed

.github/workflows/build-thirdparty.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
export PATH="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 1 -type d -name 'bin'):${PATH}"
133133
export JAVA_HOME="$(find /usr/lib/jvm/java-8-openjdk* -maxdepth 0)"
134134
export DORIS_TOOLCHAIN=gcc
135+
export CMAKE_POLICY_VERSION_MINIMUM=3.10
136+
export CUSTOM_CMAKE="/usr/local/bin/cmake"
135137
136138
cd thirdparty
137139
./build-thirdparty.sh -j "$(nproc)"
@@ -190,6 +192,8 @@ jobs:
190192
- name: Build
191193
run: |
192194
export MACOSX_DEPLOYMENT_TARGET=12.0
195+
export CMAKE_POLICY_VERSION_MINIMUM=3.10
196+
export CUSTOM_CMAKE="/usr/local/bin/cmake"
193197
194198
cd thirdparty
195199
./build-thirdparty.sh -j "$(nproc)"
@@ -248,6 +252,8 @@ jobs:
248252
- name: Build
249253
run: |
250254
export MACOSX_DEPLOYMENT_TARGET=12.0
255+
export CMAKE_POLICY_VERSION_MINIMUM=3.10
256+
export CUSTOM_CMAKE="/usr/local/bin/cmake"
251257
252258
cd thirdparty
253259
./build-thirdparty.sh -j "$(nproc)"

be/benchmark/benchmark_bit_pack.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void bit_pack(const T* input, uint8_t in_num, int bit_width, uint8_t* output) {
5050
}
5151

5252
static void BM_BitPack(benchmark::State& state) {
53-
int w = state.range(0);
53+
int w = (int)state.range(0);
5454
int n = 255;
5555

5656
std::default_random_engine e;
@@ -67,15 +67,15 @@ static void BM_BitPack(benchmark::State& state) {
6767
for (auto _ : state) {
6868
benchmark::DoNotOptimize(test_data.data());
6969
benchmark::DoNotOptimize(output.data());
70-
bit_pack(test_data.data(), n, w, output.data());
70+
bit_pack(test_data.data(), (uint8_t)n, w, output.data());
7171
benchmark::ClobberMemory();
7272
}
7373

7474
state.SetBytesProcessed(int64_t(state.iterations()) * size);
7575
}
7676

7777
static void BM_BitPackOptimized(benchmark::State& state) {
78-
int w = state.range(0);
78+
int w = (int)state.range(0);
7979
int n = 255;
8080

8181
std::default_random_engine e;
@@ -94,7 +94,7 @@ static void BM_BitPackOptimized(benchmark::State& state) {
9494
for (auto _ : state) {
9595
benchmark::DoNotOptimize(test_data.data());
9696
benchmark::DoNotOptimize(output.data());
97-
forEncoder.bit_pack(test_data.data(), n, w, output.data());
97+
forEncoder.bit_pack(test_data.data(), (uint8_t)n, w, output.data());
9898
benchmark::ClobberMemory();
9999
}
100100

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#include <benchmark/benchmark.h>
19+
20+
#include "common/status.h"
21+
#include "exprs/block_bloom_filter.hpp"
22+
23+
namespace doris {
24+
static std::unique_ptr<BlockBloomFilter> create_bloom_filter(int batch, int log_space_bytes = 20) {
25+
auto bloom_filter = std::make_unique<BlockBloomFilter>();
26+
[[maybe_unused]] Status status = bloom_filter->init(log_space_bytes, 0);
27+
28+
for (int i = 0; i < batch; i++) {
29+
bloom_filter->insert(i);
30+
}
31+
32+
return bloom_filter;
33+
}
34+
} // namespace doris
35+
36+
static void BM_BBF_BucketInsert(benchmark::State& state) {
37+
const int batch = static_cast<int>(state.range(0));
38+
auto bf = doris::create_bloom_filter(batch);
39+
40+
for (auto _ : state) {
41+
for (int i = 0; i < batch; i++) {
42+
bf->insert(i);
43+
}
44+
}
45+
46+
state.SetItemsProcessed(state.iterations() * static_cast<int64_t>(batch));
47+
}
48+
49+
static void BM_BBF_BucketFind_Hit(benchmark::State& state) {
50+
const int batch = static_cast<int>(state.range(0));
51+
auto bf = doris::create_bloom_filter(batch);
52+
53+
for (auto _ : state) {
54+
bool acc = false;
55+
for (int i = 0; i < batch; i++) {
56+
acc ^= bf->find(i);
57+
}
58+
benchmark::DoNotOptimize(acc);
59+
}
60+
state.SetItemsProcessed(state.iterations() * static_cast<int64_t>(batch));
61+
}
62+
63+
static void BM_BBF_BucketFind_Miss(benchmark::State& state) {
64+
const int batch = static_cast<int>(state.range(0));
65+
auto bf = doris::create_bloom_filter(batch);
66+
67+
for (auto _ : state) {
68+
bool acc = false;
69+
for (int i = 0; i < batch; i++) {
70+
acc ^= bf->find(i + batch);
71+
}
72+
benchmark::DoNotOptimize(acc);
73+
}
74+
state.SetItemsProcessed(state.iterations() * static_cast<int64_t>(batch));
75+
}
76+
77+
BENCHMARK(BM_BBF_BucketInsert)
78+
->Unit(benchmark::kNanosecond)
79+
->Arg(1 << 12)
80+
->Arg(1 << 15)
81+
->Arg(1 << 18)
82+
->Repetitions(5)
83+
->DisplayAggregatesOnly();
84+
BENCHMARK(BM_BBF_BucketFind_Hit)
85+
->Unit(benchmark::kNanosecond)
86+
->Arg(1 << 12)
87+
->Arg(1 << 15)
88+
->Arg(1 << 18)
89+
->Repetitions(5)
90+
->DisplayAggregatesOnly();
91+
BENCHMARK(BM_BBF_BucketFind_Miss)
92+
->Unit(benchmark::kNanosecond)
93+
->Arg(1 << 12)
94+
->Arg(1 << 15)
95+
->Arg(1 << 18)
96+
->Repetitions(5)
97+
->DisplayAggregatesOnly();

be/benchmark/benchmark_main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
#include <benchmark/benchmark.h>
1919

2020
#include "benchmark_bit_pack.hpp"
21+
#include "benchmark_block_bloom_filter.hpp"
2122
#include "benchmark_fastunion.hpp"
2223
#include "benchmark_hll_merge.hpp"
24+
#include "benchmark_string.hpp"
2325
#include "binary_cast_benchmark.hpp"
2426
#include "vec/columns/column_string.h"
2527
#include "vec/core/block.h"

0 commit comments

Comments
 (0)