feat(benchmark): add append/pk table benchmark#302
Open
lucasfang wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional Google Benchmark-based performance suite for Paimon (append-table write/read and PK-table write/MOR read), along with CMake/third-party wiring to build and run the benchmarks via CTest labels.
Changes:
- Add a
PAIMON_BUILD_BENCHMARKSbuild option and a benchmark CTest label/target integration. - Vendor/resolve Google Benchmark as a dependency (bundled/system) and add a
FindbenchmarkAlt.cmakemodule. - Add a benchmark executable with custom CLI parsing and shared helper utilities + unit tests for CLI parsing.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| third_party/versions.txt | Adds Google Benchmark version metadata for bundled dependency download. |
| CMakeLists.txt | Adds PAIMON_BUILD_BENCHMARKS option + benchmark CTest target/labels and subdir wiring. |
| cmake_modules/ThirdpartyToolchain.cmake | Adds Benchmark dependency resolution and bundled build rule. |
| cmake_modules/FindbenchmarkAlt.cmake | Adds a “system” find module for Google Benchmark. |
| cmake_modules/DefineOptions.cmake | Adds PAIMON_BUILD_BENCHMARKS and Benchmark_SOURCE options. |
| cmake_modules/BuildUtils.cmake | Adds add_paimon_benchmark / add_benchmark_case helpers and CTest labeling. |
| benchmark/CMakeLists.txt | Defines benchmark executable target and CLI parsing unit test target. |
| benchmark/read_write_benchmark.cpp | Benchmark entrypoint with custom CLI parsing + Google Benchmark init/run. |
| benchmark/cli_option_parsing.h | Inline parsing helpers for custom benchmark CLI options. |
| benchmark/cli_option_parsing_test.cpp | GTest coverage for CLI parsing helpers. |
| benchmark/benchmark_suite.h | Declares benchmark runner functions and CLI helpers. |
| benchmark/benchmark_suite.cpp | Implements benchmark suite: table setup, write/commit, read iterations, caching, CLI handling. |
| benchmark/benchmark_helpers.h | Declares shared validation/skip and read-iteration helpers. |
| benchmark/benchmark_helpers.cpp | Implements validation/skip behavior and shared read-iteration runner. |
| benchmark/benchmark_case_write.cpp | Registers BM_Write benchmark. |
| benchmark/benchmark_case_read.cpp | Registers BM_Read benchmark variants. |
| benchmark/benchmark_case_pk_write.cpp | Registers BM_PK_Write benchmark. |
| benchmark/benchmark_case_mor_read.cpp | Registers BM_MOR_Read benchmark variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+63
to
+65
| PAIMON_BENCHMARK_BUILD_VERSION=1.9.1 | ||
| PAIMON_BENCHMARK_PKG_NAME=benchmark-${PAIMON_BENCHMARK_BUILD_VERSION}.tar.gz | ||
|
|
Comment on lines
+1754
to
+1758
| externalproject_add(benchmark_ep | ||
| URL ${BENCHMARK_SOURCE_URL} | ||
| CMAKE_ARGS ${BENCHMARK_CMAKE_ARGS} | ||
| BUILD_BYPRODUCTS "${BENCHMARK_STATIC_LIB}" "${BENCHMARK_MAIN_STATIC_LIB}") | ||
|
|
Comment on lines
+15
to
+19
| set(_PAIMON_BENCHMARK_ROOTS ${Benchmark_ROOT} ${benchmark_ROOT} ${PAIMON_PACKAGE_PREFIX}) | ||
| list(REMOVE_ITEM _PAIMON_BENCHMARK_ROOTS "") | ||
| if(_PAIMON_BENCHMARK_ROOTS) | ||
| set(_PAIMON_BENCHMARK_FIND_ARGS HINTS ${_PAIMON_BENCHMARK_ROOTS} NO_DEFAULT_PATH) | ||
| endif() |
Comment on lines
+437
to
+439
| if(TARGET benchmark::benchmark_main) | ||
| list(APPEND PAIMON_BENCHMARK_LINK_TOOLCHAIN benchmark::benchmark_main) | ||
| endif() |
Comment on lines
+23
to
+40
| "-Wl,--whole-archive" | ||
| paimon_local_file_system_shared | ||
| "-Wl,--no-whole-archive" | ||
| "-Wl,--no-as-needed" | ||
| paimon_parquet_file_format_shared | ||
| paimon_blob_file_format_shared | ||
| "-Wl,--as-needed") | ||
|
|
||
| if(PAIMON_ENABLE_ORC) | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS "-Wl,--no-as-needed") | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS paimon_orc_file_format_shared) | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS "-Wl,--as-needed") | ||
| endif() | ||
|
|
||
| if(PAIMON_ENABLE_AVRO) | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS "-Wl,--no-as-needed") | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS paimon_avro_file_format_shared) | ||
| list(APPEND PAIMON_BENCHMARK_STATIC_LINK_LIBS "-Wl,--as-needed") |
Comment on lines
+56
to
+60
| ${PAIMON_BENCHMARK_STATIC_LINK_LIBS} | ||
| Threads::Threads | ||
| ${CMAKE_DL_LIBS} | ||
| rt | ||
| ${PAIMON_BENCHMARK_LINK_TOOLCHAIN}) |
Comment on lines
+155
to
+164
| struct BenchmarkWorkspace { | ||
| explicit BenchmarkWorkspace(const std::string& prefix) { | ||
| root_path = "/tmp/" + prefix + "_" + std::to_string(NextId()); | ||
| EnsureDirectory(root_path); | ||
| } | ||
|
|
||
| ~BenchmarkWorkspace() { | ||
| const std::string cleanup_cmd = "rm -rf '" + root_path + "'"; | ||
| std::system(cleanup_cmd.c_str()); | ||
| } |
| } | ||
|
|
||
| if (paimon::benchmark::HasHelpFlag(argc, argv)) { | ||
| paimon::benchmark::PrintPaimonBenchmarkCliHelp(); |
Comment on lines
+1744
to
+1745
| set(BENCHMARK_STATIC_LIB "${BENCHMARK_PREFIX}/lib/libbenchmark.a") | ||
| set(BENCHMARK_MAIN_STATIC_LIB "${BENCHMARK_PREFIX}/lib/libbenchmark_main.a") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #xxx
Add a Google Benchmark based performance suite covering:
Add a benchmark entrypoint and custom CLI parsing for:
Add benchmark helper utilities for:
Build integration updates:
Tests
UT:
Benchmark smoke:
IT:
API and Format
Documentation
Generative AI tooling
Generated-by: GitHub Copilot (GPT-5.3-Codex)