Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
749b103
[improvement](fe) Add external table metadata profile details (#63648)
Gabriel39 Jun 2, 2026
12e4082
[fix](be) Use shared IOContext in file scanner readers (#64033)
Gabriel39 Jun 3, 2026
f0fda1c
[fix](iceberg) Fix wrong processing for `NaN` (#64315)
Gabriel39 Jun 10, 2026
19fcc68
[fix](fe) Reject Iceberg v3 row lineage columns (#63825)
Gabriel39 Jun 29, 2026
64be7f3
[improvement](paimon) Support IOManager for JNI reads (#65332)
Gabriel39 Jul 8, 2026
7a190fe
[fix](iceberg) Allow optional position delete fields without nulls (#…
Gabriel39 Jul 9, 2026
e0c83ef
[feature](iceberg) Support Iceberg position deletes system table (#65…
hubgeter Jul 14, 2026
bad58be
[fix](regression) Wait past unsafe time boundaries (#65742)
Gabriel39 Jul 17, 2026
59b673f
[fix](fe) Support ClickHouse JDBC V2 metadata (#65709)
Gabriel39 Jul 17, 2026
388c55d
[fix](scanner)(nereids) Harden FileScannerV2 and fix external COUNT p…
Gabriel39 Jul 20, 2026
5e1b8d2
[fix](iceberg) make iceberg deletion vector stable. (#65676)
hubgeter Jul 20, 2026
cb671ad
[fix](topn) Resolve topn lazy materialization column indexes for alia…
hubgeter Jul 21, 2026
c0a2f82
[fix](iceberg) Honor disabled write metrics (#65782)
Gabriel39 Jul 21, 2026
cbd77b9
[fix](iceberg) Honor partial name mappings for legacy files (#65784)
Gabriel39 Jul 22, 2026
09441bb
[improvement](file) Build native Parquet scan path for FileScannerV2 …
Gabriel39 Jul 22, 2026
c8fba22
[fix](test) Stabilize timing-sensitive FE unit tests
Gabriel39 Jul 23, 2026
01c4b2d
[fix](test) Preserve Iceberg split format coverage after rebase
Gabriel39 Jul 23, 2026
a943f4b
[bench](parquet) Add native reader microbenchmark matrix (#65921)
Gabriel39 Jul 23, 2026
3b3aed6
[improvement](be) Optimize projected fixed-width Parquet predicate fi…
Gabriel39 Jul 23, 2026
9259acb
[improvement](file) Execute split residual predicates in TableReader …
Gabriel39 Jul 23, 2026
f50b4eb
[fix](test) Use branch-native runtime filter wrapper in scanner test
Gabriel39 Jul 23, 2026
e191594
[fix](file) Resolve remaining FileScannerV2 audit issues (#65931)
Gabriel39 Jul 23, 2026
ccc77cc
[fix](branch-4.1) Adapt external scan compatibility
Gabriel39 Jul 23, 2026
2287c7c
[fix](iceberg) Finalize position delete reader columns
Gabriel39 Jul 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
87 changes: 83 additions & 4 deletions be/benchmark/benchmark_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,77 @@

#include <benchmark/benchmark.h>

#include <cstdlib>
#include <filesystem>
#include <iostream>
#include <vector>

#include "benchmark_arrow_validation.hpp"
#include "benchmark_bit_pack.hpp"
#include "benchmark_bits.hpp"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep the benchmark main within the backported source set

This first new include, plus eight others added below, names a header that does not exist anywhere on branch-4.1 or in this PR, so benchmark_test stops during preprocessing. There is a second independent omission later in this file: enable_bmi2_optimizations is also undeclared on this branch. Please either backport the nine benchmark sources and the matching config definition with their dependencies, or retain only the benchmark registrations/configuration that actually exist here; then compile the benchmark target in validation.

#include "benchmark_block_bloom_filter.hpp"
#include "benchmark_column_array_view.hpp"
#include "benchmark_column_array_view_distance.hpp"
#include "benchmark_column_view.hpp"
#include "benchmark_damerau_levenshtein.hpp"
#include "benchmark_fastunion.hpp"
#include "benchmark_fmod.hpp"
#include "benchmark_hll_merge.hpp"
#include "benchmark_hybrid_set.hpp"
#include "benchmark_pdep_unpack.hpp"
#include "benchmark_string.hpp"
#include "benchmark_string_replace.hpp"
#include "benchmark_zone_map_index.hpp"
#include "binary_cast_benchmark.hpp"
#include "common/config.h"
#include "core/block/block.h"
#include "vec/columns/column_string.h"
#include "vec/data_types/data_type.h"
#include "vec/data_types/data_type_string.h"
#include "core/column/column_string.h"
#include "core/data_type/data_type.h"
#include "core/data_type/data_type_string.h"
#include "parquet/benchmark_parquet_decoder.hpp"
#include "parquet/benchmark_parquet_reader.hpp"
#include "runtime/exec_env.h"
#include "runtime/memory/mem_tracker_limiter.h"
#include "runtime/memory/thread_mem_tracker_mgr.h"
#include "runtime/thread_context.h"

// benchmark_binary_plain_page_v2.hpp must be included LAST: it transitively pulls AWS SDK
// headers (via storage/cache/page_cache.h) whose symbols shadow types used by the benchmark
// headers above (notably binary_cast_benchmark.hpp). Keeping it last avoids the clash without
// disabling any benchmark. (Do not let clang-format reorder it above the others.)
#include "benchmark_binary_plain_page_v2.hpp"

namespace doris { // change if need

static bool init_benchmark_config(const char* executable) {
std::vector<std::filesystem::path> candidates;
if (const char* doris_home = std::getenv("DORIS_HOME"); doris_home != nullptr) {
candidates.emplace_back(std::filesystem::path(doris_home) / "conf" / "be.conf");
}
candidates.emplace_back(std::filesystem::current_path() / "conf" / "be.conf");
const auto executable_dir = std::filesystem::absolute(executable).parent_path();
candidates.emplace_back(executable_dir / ".." / ".." / "conf" / "be.conf");
candidates.emplace_back(executable_dir / ".." / ".." / ".." / "conf" / "be.conf");
for (const auto& candidate : candidates) {
if (!std::filesystem::exists(candidate)) {
continue;
}
if (std::getenv("DORIS_HOME") == nullptr) {
const auto inferred_home = candidate.parent_path().parent_path().string();
// be.conf contains paths relative to DORIS_HOME. Keep standalone benchmark launches
// equivalent to build/test scripts after locating the same repository config.
if (::setenv("DORIS_HOME", inferred_home.c_str(), 0) != 0) {
return false;
}
}
// Mutable config storage is populated by config::init. Reader benchmarks must use the
// production defaults because zero-initialized safety limits reject every valid footer.
return config::init(candidate.c_str(), false);
}
std::cerr << "Unable to find conf/be.conf for benchmark initialization\n";
return false;
}

static void Example1(benchmark::State& state) {
// init. dont time it.
state.PauseTiming();
Expand All @@ -55,4 +110,28 @@ static void Example1(benchmark::State& state) {
BENCHMARK(Example1);
} // namespace doris

BENCHMARK_MAIN();
// Custom main: benchmarks that touch DataPage allocation require a Doris
// ThreadContext + mem tracker, otherwise the allocator throws E-7412. Mirrors
// the minimal subset of be/test/testutil/run_all_tests.cpp::main.
int main(int argc, char** argv) {
if (!doris::init_benchmark_config(argv[0])) {
return 1;
}
doris::config::enable_bmi2_optimizations = true;

SCOPED_INIT_THREAD_CONTEXT();
doris::ExecEnv::GetInstance()->init_mem_tracker();
doris::thread_context()->thread_mem_tracker_mgr->init();
auto bench_tracker = doris::MemTrackerLimiter::create_shared(
doris::MemTrackerLimiter::Type::GLOBAL, "BE-BENCH");
doris::thread_context()->thread_mem_tracker_mgr->attach_limiter_tracker(bench_tracker);
doris::ExecEnv::set_tracking_memory(false);

::benchmark::Initialize(&argc, argv);
if (::benchmark::ReportUnrecognizedArguments(argc, argv)) {
return 1;
}
::benchmark::RunSpecifiedBenchmarks();
::benchmark::Shutdown();
return 0;
}
Loading
Loading