Skip to content

Commit

Permalink
CI: add benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Oct 10, 2023
1 parent 419dc2e commit 31c2c33
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/benchmarks/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -eu

CMAKE_ARGS=(
"-DUSE_CCACHE=ON" \
"-DCMAKE_BUILD_TYPE=Release" \
"-DCMAKE_INSTALL_PREFIX=/usr" \
"-DGDAL_USE_TIFF_INTERNAL=ON" \
"-DGDAL_USE_GEOTIFF_INTERNAL=ON" \
"-DECW_ROOT=/opt/libecwj2-3.3" \
"-DMRSID_ROOT=/usr/local" \
"-DFileGDB_ROOT=/usr/local/FileGDB_API" \
"-DBUILD_CSHARP_BINDINGS=OFF" \
"-DBUILD_JAVA_BINDINGS=OFF" \
"-DGDAL_BUILD_OPTIONAL_DRIVERS=OFF" \
"-DOGR_BUILD_OPTIONAL_DRIVERS=OFF" \
"-DOGR_ENABLE_DRIVER_GPKG=ON" \
)

cmake ${GDAL_SOURCE_DIR:=..} \
"${CMAKE_ARGS[@]}"

make -j$(nproc)

mkdir old_version
cd old_version
# To be updated with a true reference branch and commit
git clone https://github.com/rouault/gdal
cd gdal
git checkout 419dc2e64b19964cfe61d9140c4affe8298c475d
mkdir build
cd build

cmake .. \
"${CMAKE_ARGS[@]}"

make -j$(nproc)
9 changes: 9 additions & 0 deletions .github/workflows/benchmarks/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -eu

BENCHMARK_STORAGE="file:///tmp"

(cd old_version/gdal/build; source ../scripts/setdevenv.sh; pytest autotest/benchmark --benchmark-save=ref "--benchmark-storage=${BENCHMARK_STORAGE}" --capture=no -ra -vv)

(source ${GDAL_SOURCE_DIR:=..}/scripts/setdevenv.sh; pytest autotest/benchmark --benchmark-compare-fail="min:5%" --benchmark-compare=0001_ref "--benchmark-storage=${BENCHMARK_STORAGE}" --capture=no -ra -vv)
14 changes: 14 additions & 0 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
build_script: build.sh
test_script: test.sh

- name: Ubuntu 20.04, benchmarks
id: benchmarks
travis_branch: ubuntu_2004
container: ubuntu_20.04
build_script: build.sh
test_script: test.sh

- name: Ubuntu 20.04, Intel compiler
id: icc
container: icc
Expand Down Expand Up @@ -269,6 +276,13 @@ jobs:
TEST_CMD="ctest -V -j $(nproc)"
fi
if test "${{ matrix.id }}" = "benchmarks"; then
if test -f /sys/devices/system/cpu/intel_pstate/no_turbo; then
echo "Disable TurboBoost"
echo 1 | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
fi
fi
# For cache
mkdir .gdal
Expand Down

0 comments on commit 31c2c33

Please sign in to comment.