launched benchmarks #88
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
| name: benchmarks | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| posix: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: gcc-x64 | |
| compiler: g++-15 | |
| architecture: -m64 | |
| sourcefile: benchmark.cpp | |
| compileroptions: -std=c++23 -O3 -DNDEBUG | |
| outputfile: benchmark | |
| reportdir: gcc-x64 | |
| os: ubuntu-latest | |
| container: ubuntu:25.04 | |
| install: g++-15-multilib | |
| command: ./benchmark | |
| - name: clang-x64 | |
| compiler: clang++-20 | |
| architecture: -m64 | |
| sourcefile: benchmark.cpp | |
| compileroptions: -std=c++23 -O3 -DNDEBUG | |
| outputfile: benchmark | |
| reportdir: clang-x64 | |
| container: ubuntu:25.04 | |
| os: ubuntu-latest | |
| install: clang-20 | |
| command: ./benchmark | |
| - name: clang-arm64 | |
| compiler: clang++ | |
| architecture: -m64 | |
| sourcefile: benchmark.cpp | |
| compileroptions: -std=c++20 -O3 -DNDEBUG | |
| outputfile: benchmark | |
| reportdir: clang-arm64 | |
| os: macos-15 | |
| command: ./benchmark | |
| - name: gcc-x86 | |
| compiler: g++-15 | |
| architecture: -m32 | |
| sourcefile: benchmark.cpp | |
| compileroptions: -std=c++23 -O3 -DNDEBUG | |
| outputfile: benchmark | |
| reportdir: gcc-x86 | |
| os: ubuntu-latest | |
| container: ubuntu:25.04 | |
| install: g++-15-multilib | |
| command: ./benchmark | |
| - name: clang-x86 | |
| compiler: clang++-20 | |
| architecture: -m32 | |
| sourcefile: benchmark.cpp | |
| compileroptions: -std=c++23 -O3 -DNDEBUG | |
| outputfile: benchmark | |
| reportdir: clang-x86 | |
| container: ubuntu:25.04 | |
| os: ubuntu-latest | |
| install: clang-20 g++-multilib libc6-dev-i386 libstdc++-13-dev:i386 | |
| command: ./benchmark | |
| runs-on: ${{matrix.os}} | |
| container: | |
| image: ${{matrix.container}} | |
| volumes: | |
| - /node20217:/node20217:rw,rshared | |
| - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} | |
| steps: | |
| - name: Setup container environment | |
| if: matrix.container | |
| run: | | |
| apt-get update | |
| apt-get -y install sudo python3 git g++ curl xz-utils | |
| if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then | |
| # Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590 | |
| curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 | |
| fi | |
| - uses: actions/checkout@v3 | |
| - name: Install packages | |
| if: matrix.install | |
| run: | | |
| # sudo -E apt-add-repository -y ppa:ubuntu-toolchain-r/test | |
| if uname -p | grep -q 'x86_64'; then sudo dpkg --add-architecture i386 ; fi | |
| sudo apt-get update | |
| sudo apt-get install -y ${{matrix.install}} | |
| - name: Install Boost | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| git clone https://github.com/boostorg/boost.git boost-root | |
| cd boost-root | |
| git checkout develop | |
| git submodule update --init | |
| ./bootstrap.sh | |
| ./b2 -d0 headers | |
| - name: Install Candidate Boost.Hub | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| git clone https://github.com/joaquintides/hub.git hub-root | |
| - name: Install plf_hive | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| git clone https://github.com/mattreecebentley/plf_hive.git hive-root | |
| - name: Compile and run benchmarks | |
| run: | | |
| set -euo pipefail | |
| cd $GITHUB_WORKSPACE | |
| ${{matrix.compiler}} --version | |
| if [ -n "${{matrix.xcode_version}}" ]; then | |
| DEVELOPER_DIR=/Applications/Xcode-${{matrix.xcode_version}}.app/Contents/Developer | |
| fi | |
| for ELEMENT_SIZE in 16 32 64 80; do | |
| ${{matrix.compiler}} $GITHUB_WORKSPACE/${{matrix.sourcefile}} ${{matrix.architecture}} ${{matrix.compileroptions}} -o ${{matrix.outputfile}} \ | |
| -I$GITHUB_WORKSPACE/hub-root/include -I$GITHUB_WORKSPACE/hive-root -I$GITHUB_WORKSPACE/boost-root \ | |
| -DELEMENT_SIZE=${ELEMENT_SIZE} -DNONTRIVIAL_ELEMENT | |
| ${{matrix.command}} "${{matrix.reportdir}}/element_${ELEMENT_SIZE}.txt" | |
| done | |
| - name: Push benchmark results to repo | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config --global user.name 'joaquintides' | |
| git config --global user.email 'joaquintides@users.noreply.github.com' | |
| git add ${{matrix.reportdir}} | |
| git stash -- ${{matrix.reportdir}} | |
| git pull | |
| git stash pop | |
| git add ${{matrix.reportdir}} | |
| git commit -m "updated benchmark results" | |
| git push | |
| windows: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: vs-x64 | |
| compiler: cl | |
| architecture: x64 | |
| sourcefile: benchmark.cpp | |
| compileroptions: /std:c++20 /O2 /GL /D "NDEBUG" /EHsc /MD /Fe:benchmark.exe /arch:AVX2 | |
| outputfile: benchmark.exe | |
| reportdir: vs-x64 | |
| os: windows-2025 | |
| command: benchmark | |
| - name: vs-x86 | |
| compiler: cl | |
| architecture: x86 | |
| sourcefile: benchmark.cpp | |
| compileroptions: /std:c++20 /O2 /GL /D "NDEBUG" /EHsc /MD /Fe:benchmark.exe /arch:AVX2 | |
| outputfile: benchmark.exe | |
| reportdir: vs-x86 | |
| os: windows-2025 | |
| command: benchmark | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Boost | |
| shell: cmd | |
| run: | | |
| cd %GITHUB_WORKSPACE% | |
| git clone https://github.com/boostorg/boost.git boost-root | |
| cd boost-root | |
| git checkout develop | |
| git submodule update --init | |
| cmd /c bootstrap.bat | |
| .\b2.exe -d0 headers | |
| - name: Install Candidate Boost.Hub | |
| shell: cmd | |
| run: | | |
| cd %GITHUB_WORKSPACE% | |
| git clone https://github.com/joaquintides/hub.git hub-root | |
| - name: Install plf_hive | |
| shell: cmd | |
| run: | | |
| cd %GITHUB_WORKSPACE% | |
| git clone https://github.com/mattreecebentley/plf_hive.git hive-root | |
| - name: Compile and run benchmarks | |
| shell: cmd | |
| run: | | |
| setlocal EnableExtensions EnableDelayedExpansion | |
| cd %GITHUB_WORKSPACE% | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.architecture}} | |
| set INCLUDE=%INCLUDE%;%GITHUB_WORKSPACE%\hub-root\include;%GITHUB_WORKSPACE%\hive-root;%GITHUB_WORKSPACE%\boost-root | |
| echo %INCLUDE% | |
| for %%S in (16 32 64 80) do ( | |
| set "DEFINES=/DELEMENT_SIZE=%%S /DNONTRIVIAL_ELEMENT" | |
| ${{matrix.compiler}} %GITHUB_WORKSPACE%\${{matrix.sourcefile}} ${{matrix.compileroptions}} !DEFINES! | |
| if errorlevel 1 exit /b 1 | |
| ${{matrix.command}} "${{matrix.reportdir}}\element_%%S.txt" | |
| ) | |
| - name: Push benchmark results to repo | |
| shell: powershell | |
| run: | | |
| git config --global --add safe.directory "$env:GITHUB_WORKSPACE" | |
| git config --global user.name 'joaquintides' | |
| git config --global user.email 'joaquintides@users.noreply.github.com' | |
| git add ${{matrix.reportdir}} | |
| git stash -- ${{matrix.reportdir}} | |
| git pull | |
| git stash pop | |
| git add ${{matrix.reportdir}} | |
| git commit -m "updated benchmark results" | |
| git push | |
| final: | |
| needs: [posix,windows] | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: python:2.7.18-buster | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Fast-forward repo | |
| run: | | |
| git pull | |
| - name: Run data feeding script | |
| run: | | |
| ./insert_data.sh | |
| - name: Push modified README.md to repo | |
| run: | | |
| git config --global --add safe.directory "$env:GITHUB_WORKSPACE" | |
| git config --global user.name 'joaquintides' | |
| git config --global user.email 'joaquintides@users.noreply.github.com' | |
| git commit -am "updated README.md" | |
| git push |