-
Notifications
You must be signed in to change notification settings - Fork 21
Add comparative benchmarks #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Alex-PLACET
wants to merge
11
commits into
man-group:main
Choose a base branch
from
Alex-PLACET:add_comparative_benchmarks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b3b7cbe
Add comparative benchmarks
Alex-PLACET 7de72f9
wip
Alex-PLACET e73333c
wip
Alex-PLACET 04ba0aa
wip
Alex-PLACET 2f9398f
wip
Alex-PLACET 4c1fc0d
Add benchmark comparative in ci
Alex-PLACET 55e22c9
documentation
Alex-PLACET acc7bc0
fix
Alex-PLACET dd9b8ab
fix
Alex-PLACET 8f31b99
fix
Alex-PLACET 00e7dad
fix
Alex-PLACET File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,115 +23,121 @@ jobs: | |
date-polyfill: [OFF] | ||
shared: [OFF] | ||
cpp_standard: [20] | ||
|
||
runs-on: ${{ matrix.os }} | ||
name: Benchmark / ${{matrix.os}} / ${{ matrix.compiler }} / ${{ matrix.version }} / ${{ matrix.arch }} / ${{ matrix.config }} / date-polyfill ${{ matrix.date-polyfill}} / shared ${{ matrix.shared }} / cpp${{ matrix.cpp_standard }} | ||
env: | ||
SCCACHE_GHA_ENABLED: "true" | ||
|
||
steps: | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Install pthread | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libpthread-stubs0-dev libboost-thread-dev | ||
|
||
- uses: rui314/setup-mold@v1 | ||
with: | ||
mold-version: 2.40.1 | ||
make-default: true | ||
|
||
- name: Install GCC | ||
if: matrix.compiler == 'gcc' | ||
uses: egor-tensin/setup-gcc@v1 | ||
with: | ||
version: ${{matrix.version}} | ||
platform: x64 | ||
|
||
- name: Install LLVM and Clang | ||
if: matrix.compiler == 'clang' | ||
run: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh ${{matrix.version}} | ||
sudo apt-get install -y clang-tools-${{matrix.version}} | ||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.version}} 200 | ||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.version}} 200 | ||
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.version}} 200 | ||
sudo update-alternatives --set clang /usr/bin/clang-${{matrix.version}} | ||
sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.version}} | ||
sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.version}} | ||
|
||
- name: Install specific version of tzdata | ||
if: matrix.date-polyfill == 'OFF' | ||
run: sudo apt-get install tzdata=2024a-2ubuntu1 -y --allow-downgrades | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set conda environment | ||
uses: mamba-org/setup-micromamba@main | ||
with: | ||
environment-name: myenv | ||
environment-file: environment-dev.yml | ||
init-shell: bash | ||
cache-downloads: true | ||
|
||
- name: Configure using CMake | ||
run: | | ||
if [[ "${{matrix.compiler}}" = "gcc" ]]; then export CC=gcc-${{matrix.version}}; export CXX=g++-${{matrix.version}}; else export CC=clang; export CXX=clang++; fi | ||
cmake -G Ninja \ | ||
-Bbuild \ | ||
-DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} \ | ||
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ | ||
-DCMAKE_CXX_STANDARD=${{matrix.cpp_standard}} \ | ||
-DUSE_DATE_POLYFILL=${{matrix.date-polyfill}} \ | ||
-DBUILD_TESTS=OFF \ | ||
-DENABLE_INTEGRATION_TEST=OFF \ | ||
-DBUILD_EXAMPLES=OFF \ | ||
-DBUILD_BENCHMARKS=ON \ | ||
-DBUILD_COMPARATIVE_BENCHMARKS=ON \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING \ | ||
-DSPARROW_BUILD_SHARED=${{matrix.shared}} \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \ | ||
-DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold" | ||
|
||
- name: Build the benchmark target(s) | ||
working-directory: build | ||
run: | | ||
cmake --build . --config ${{matrix.config}} --target sparrow_benchmarks | ||
cmake --build . --config ${{matrix.config}} --target sparrow_benchmarks_comparative | ||
|
||
- name: Run benchmarks | ||
working-directory: build | ||
run: | | ||
cmake --build . --config ${{matrix.config}} --target run_benchmarks_json | ||
cmake --build . --config ${{matrix.config}} --target run_comparative_benchmarks_json | ||
|
||
- name: Upload benchmark results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: benchmark-results | ||
path: | | ||
./**/sparrow_benchmarks.json | ||
./**/sparrow_benchmarks_comparative.json | ||
|
||
- name: Download previous benchmark data | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmarks | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
# What benchmark tool the output.txt came from | ||
tool: "googlecpp" | ||
# Where the output from the benchmark tool is stored | ||
output-file-path: build/benchmarks/sparrow_benchmarks.json | ||
# Where the previous data file is stored | ||
external-data-json-path: ./cache/benchmark-data.json | ||
# Workflow will fail when an alert happens | ||
fail-on-alert: true | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Install pthread | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libpthread-stubs0-dev libboost-thread-dev | ||
|
||
- uses: rui314/setup-mold@v1 | ||
with: | ||
mold-version: 2.40.1 | ||
make-default: true | ||
|
||
- name: Install GCC | ||
if: matrix.compiler == 'gcc' | ||
uses: egor-tensin/setup-gcc@v1 | ||
with: | ||
version: ${{matrix.version}} | ||
platform: x64 | ||
|
||
- name: Install LLVM and Clang | ||
if: matrix.compiler == 'clang' | ||
run: | | ||
wget https://apt.llvm.org/llvm.sh | ||
chmod +x llvm.sh | ||
sudo ./llvm.sh ${{matrix.version}} | ||
sudo apt-get install -y clang-tools-${{matrix.version}} | ||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.version}} 200 | ||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.version}} 200 | ||
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.version}} 200 | ||
sudo update-alternatives --set clang /usr/bin/clang-${{matrix.version}} | ||
sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.version}} | ||
sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.version}} | ||
|
||
- name: Install specific version of tzdata | ||
if: matrix.date-polyfill == 'OFF' | ||
run: sudo apt-get install tzdata=2024a-2ubuntu1 -y --allow-downgrades | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set conda environment | ||
uses: mamba-org/setup-micromamba@main | ||
with: | ||
environment-name: myenv | ||
environment-file: environment-dev.yml | ||
init-shell: bash | ||
cache-downloads: true | ||
|
||
- name: Configure using CMake | ||
run: | | ||
if [[ "${{matrix.compiler}}" = "gcc" ]]; then export CC=gcc-${{matrix.version}}; export CXX=g++-${{matrix.version}}; else export CC=clang; export CXX=clang++; fi | ||
cmake -G Ninja \ | ||
-Bbuild \ | ||
-DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} \ | ||
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ | ||
-DCMAKE_CXX_STANDARD=${{matrix.cpp_standard}} \ | ||
-DUSE_DATE_POLYFILL=${{matrix.date-polyfill}} \ | ||
-DBUILD_TESTS=OFF \ | ||
-DENABLE_INTEGRATION_TEST=OFF \ | ||
-DBUILD_EXAMPLES=OFF \ | ||
-DBUILD_BENCHMARKS=ON \ | ||
-DCMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
-DFETCH_DEPENDENCIES_WITH_CMAKE=MISSING \ | ||
-DSPARROW_BUILD_SHARED=${{matrix.shared}} \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \ | ||
-DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold" | ||
|
||
- name: Build the benchmark target(s) | ||
working-directory: build | ||
run: cmake --build . --config ${{matrix.config}} --target sparrow_benchmarks | ||
|
||
- name: Run benchmarks | ||
working-directory: build | ||
run: cmake --build . --config ${{matrix.config}} --target run_benchmarks_json | ||
|
||
- name: Upload benchmark results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: benchmark-results | ||
path: ./**/sparrow_benchmarks.json | ||
|
||
- name: Download previous benchmark data | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./cache | ||
key: ${{ runner.os }}-benchmarks | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
# What benchmark tool the output.txt came from | ||
tool: 'googlecpp' | ||
# Where the output from the benchmark tool is stored | ||
output-file-path: build/benchmarks/sparrow_benchmarks.json | ||
# Where the previous data file is stored | ||
external-data-json-path: ./cache/benchmark-data.json | ||
# Workflow will fail when an alert happens | ||
fail-on-alert: true | ||
|
||
- name: Run sccache stat for check | ||
shell: bash | ||
run: ${SCCACHE_PATH} --show-stats | ||
- name: Run sccache stat for check | ||
shell: bash | ||
run: ${SCCACHE_PATH} --show-stats |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Comparative benchmarks between sparrow and Apache Arrow | ||
|
||
message(STATUS "Configuring comparative benchmarks...") | ||
|
||
add_executable(sparrow_benchmarks_comparative | ||
benchmark_primitive.cpp | ||
) | ||
|
||
target_link_libraries(sparrow_benchmarks_comparative | ||
PRIVATE | ||
sparrow | ||
arrow_static | ||
benchmark::benchmark | ||
benchmark::benchmark_main | ||
) | ||
|
||
set(ARROW_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/_deps/arrow-src/cpp/src ${CMAKE_BINARY_DIR}/_deps/arrow-build/src) | ||
|
||
target_include_directories(sparrow_benchmarks_comparative | ||
PRIVATE | ||
${ARROW_INCLUDE_DIRS} | ||
) | ||
|
||
message("Arrow include dir: ${ARROW_INCLUDE_DIR}") | ||
|
||
set_target_properties(sparrow_benchmarks_comparative PROPERTIES FOLDER "Benchmarks") | ||
|
||
add_custom_target(run_comparative_benchmarks | ||
COMMAND sparrow_benchmarks_comparative | ||
DEPENDS sparrow_benchmarks_comparative | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Running comparative benchmarks (sparrow vs Arrow)" | ||
) | ||
set_target_properties(run_comparative_benchmarks PROPERTIES FOLDER "Benchmarks") | ||
|
||
add_custom_target(run_comparative_benchmarks_json | ||
COMMAND sparrow_benchmarks_comparative --benchmark_format=json --benchmark_out=sparrow_benchmarks_comparative.json | ||
DEPENDS sparrow_benchmarks_comparative | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
COMMENT "Running comparative benchmarks (JSON output)" | ||
) | ||
set_target_properties(run_comparative_benchmarks_json PROPERTIES FOLDER "Benchmarks") |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.