diff --git a/.github/workflows/benchmarks/build.sh b/.github/workflows/benchmarks/build.sh new file mode 100755 index 000000000000..d8f0870f14fb --- /dev/null +++ b/.github/workflows/benchmarks/build.sh @@ -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) diff --git a/.github/workflows/benchmarks/test.sh b/.github/workflows/benchmarks/test.sh new file mode 100755 index 000000000000..4cb95ac9fad0 --- /dev/null +++ b/.github/workflows/benchmarks/test.sh @@ -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) diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 2d160ba7288b..44cca92f60ff 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -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 @@ -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