mirror of
https://github.com/boostorg/boost_unordered_benchmarks.git
synced 2026-02-18 14:02:09 +00:00
307 lines
12 KiB
YAML
307 lines
12 KiB
YAML
name: benchmarks
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- parallel_hashmap_benchmark
|
|
|
|
jobs:
|
|
posix:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: gcc-x64
|
|
compiler: g++-11
|
|
architecture: -m64
|
|
vcpkgtriplet: x64-linux
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik9.zip
|
|
compileroptions: -std=c++2a -O3 -DNDEBUG -DCFOA_EMBEDDED_GROUP_ACCESS
|
|
outputfile: benchmark
|
|
reportdir: gcc-x64
|
|
os: [self-hosted, linux, x64]
|
|
install: g++-11 curl zip unzip tar pkg-config
|
|
command: sudo cset shield --exec -- nice -n -20 sudo -u gha ./benchmark
|
|
|
|
- name: clang-x64
|
|
compiler: clang++-12
|
|
architecture: -m64
|
|
vcpkgtriplet: x64-linux
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik9.zip
|
|
compileroptions: -std=c++2a -O3 -DNDEBUG -DCFOA_EMBEDDED_GROUP_ACCESS
|
|
outputfile: benchmark
|
|
reportdir: clang-x64
|
|
os: [self-hosted, linux, x64]
|
|
install: curl zip unzip tar pkg-config
|
|
command: sudo cset shield --exec -- nice -n -20 sudo -u gha ./benchmark
|
|
|
|
- name: clang-arm64
|
|
compiler: clang++
|
|
architecture: -m64
|
|
vcpkgtriplet: arm64-osx
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik9.zip
|
|
compileroptions: -std=c++2a -O3 -DNDEBUG -DCFOA_EMBEDDED_GROUP_ACCESS -DNUM_THREADS=8
|
|
outputfile: benchmark
|
|
reportdir: clang-arm64
|
|
os: [self-hosted, macOS, ARM64]
|
|
command: ./benchmark
|
|
xcode_version: 13.4.1
|
|
|
|
- name: gcc-x86
|
|
compiler: g++-11
|
|
architecture: -m32
|
|
vcpkgtriplet: x86-linux
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik8.zip
|
|
compileroptions: -std=c++2a -O3 -DNDEBUG -DCFOA_EMBEDDED_GROUP_ACCESS
|
|
outputfile: benchmark
|
|
reportdir: gcc-x86
|
|
os: [self-hosted, linux, x64]
|
|
install: g++-11 curl zip unzip tar pkg-config
|
|
command: sudo cset shield --exec -- nice -n -20 sudo -u gha ./benchmark
|
|
|
|
- name: clang-x86
|
|
compiler: clang++-12
|
|
architecture: -m32
|
|
vcpkgtriplet: x86-linux
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik8.zip
|
|
compileroptions: -std=c++2a -O3 -DNDEBUG -DCFOA_EMBEDDED_GROUP_ACCESS -latomic
|
|
outputfile: benchmark
|
|
reportdir: clang-x86
|
|
os: [self-hosted, linux, x64]
|
|
install: curl zip unzip tar pkg-config
|
|
command: sudo cset shield --exec -- nice -n -20 sudo -u gha ./benchmark
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
steps:
|
|
- 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: Download large data files
|
|
if: matrix.download-datafiles
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
for URL in ${{matrix.download-datafiles}}; do
|
|
FILENAME="${URL##*/}"
|
|
curl $URL --output $FILENAME
|
|
unzip $FILENAME
|
|
rm $FILENAME
|
|
done
|
|
- 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 Boost.Unordered branch feature/cfoa
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
git clone -b feature/cfoa https://github.com/boostorg/unordered.git boost_unordered-root
|
|
- name: Install oneTBB
|
|
run: |
|
|
if [ -n "${{matrix.xcode_version}}" ]; then
|
|
export PATH=/opt/homebrew/bin:$PATH
|
|
cd ~
|
|
mkdir -p .vcpkg
|
|
touch .vcpkg/vcpkg.path.txt
|
|
else
|
|
cd $GITHUB_WORKSPACE
|
|
mkdir -p .vcpkg
|
|
touch .vcpkg/vcpkg.path.txt
|
|
fi
|
|
cd $GITHUB_WORKSPACE
|
|
git clone https://github.com/Microsoft/vcpkg.git
|
|
cp x86-linux.cmake vcpkg/triplets
|
|
cd vcpkg
|
|
./bootstrap-vcpkg.sh -disableMetrics
|
|
./vcpkg integrate install
|
|
./vcpkg install tbb:${{matrix.vcpkgtriplet}}
|
|
- name: Install libcuckoo
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
git clone https://github.com/efficient/libcuckoo.git libcuckoo-root
|
|
- name: Install gtl
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
git clone https://github.com/greg7mdp/gtl.git gtl-root
|
|
- name: Compile
|
|
run: |
|
|
cd $GITHUB_WORKSPACE
|
|
${{matrix.compiler}} --version
|
|
${{matrix.compiler}} ${{matrix.sourcefile}} ${{matrix.architecture}} ${{matrix.compileroptions}} -o ${{matrix.outputfile}} -I$GITHUB_WORKSPACE/boost_unordered-root/include -I$GITHUB_WORKSPACE/boost-root -I$GITHUB_WORKSPACE/vcpkg/installed/${{matrix.vcpkgtriplet}}/include -I$GITHUB_WORKSPACE/libcuckoo-root/libcuckoo -I$GITHUB_WORKSPACE/gtl-root/include -L$GITHUB_WORKSPACE/vcpkg/installed/${{matrix.vcpkgtriplet}}/lib -pthread -ltbb -ltbbmalloc
|
|
- name: Set reportfile name
|
|
run: |
|
|
echo "REPORT_FILE=${{matrix.reportdir}}/${{matrix.sourcefile}}.txt" >> $GITHUB_ENV
|
|
- name: Run benchmarks
|
|
run: |
|
|
if [ -n "${{matrix.xcode_version}}" ]; then
|
|
DEVELOPER_DIR=/Applications/Xcode-${{matrix.xcode_version}}.app/Contents/Developer
|
|
fi
|
|
if [ -n "${{matrix.command}}" ]; then
|
|
echo "running benchmarks and saving to "${REPORT_FILE}
|
|
${{matrix.command}} | tee ${REPORT_FILE}
|
|
else
|
|
echo "running benchmarks and saving to "${REPORT_FILE}
|
|
./${{matrix.outputfile}} | tee ${REPORT_FILE}
|
|
fi
|
|
- name: Push benchmark results to repo
|
|
run: |
|
|
git config --global user.name 'joaquintides'
|
|
git config --global user.email 'joaquintides@users.noreply.github.com'
|
|
git add ${REPORT_FILE}
|
|
git stash -- ${REPORT_FILE}
|
|
git pull
|
|
git stash pop
|
|
git add ${REPORT_FILE}
|
|
git commit -m "updated benchmark results"
|
|
git push
|
|
|
|
windows:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: vs-x64
|
|
compiler: cl
|
|
architecture: x64
|
|
vcpkgtriplet: x64-windows
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik9.zip
|
|
compileroptions: /std:c++20 /O2 /GL /D "NDEBUG" /D "CFOA_EMBEDDED_GROUP_ACCESS" /D "NUM_THREADS=4" /EHsc /MD /Fe:benchmark.exe
|
|
outputfile: benchmark.exe
|
|
reportdir: vs-x64
|
|
os: [self-hosted, Windows, X64]
|
|
|
|
- name: vs-x86
|
|
compiler: cl
|
|
architecture: x86
|
|
vcpkgtriplet: x86-windows
|
|
sourcefile: main.cpp
|
|
download-datafiles: http://mattmahoney.net/dc/enwik8.zip
|
|
compileroptions: /std:c++20 /O2 /GL /D "NDEBUG" /D "CFOA_EMBEDDED_GROUP_ACCESS" /D "NUM_THREADS=4" /EHsc /MD /Fe:benchmark.exe
|
|
outputfile: benchmark.exe
|
|
reportdir: vs-x86
|
|
os: [self-hosted, Windows, X64]
|
|
|
|
runs-on: ${{matrix.os}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Download large data files
|
|
if: matrix.download-datafiles
|
|
shell: powershell
|
|
run: |
|
|
cd $env:GITHUB_WORKSPACE
|
|
Foreach ($Url in "${{matrix.download-datafiles}}".split())
|
|
{
|
|
$Url=$Url.trim()
|
|
$Filename=$Url.substring($Url.lastIndexOf("/")+1)
|
|
Invoke-WebRequest -Uri $Url -OutFile $Filename
|
|
Expand-Archive $Filename -DestinationPath .
|
|
rm $Filename
|
|
}
|
|
- 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 Boost.Unordered branch feature/cfoa
|
|
shell: cmd
|
|
run: |
|
|
cd %GITHUB_WORKSPACE%
|
|
git clone -b feature/cfoa https://github.com/boostorg/unordered.git boost_unordered-root
|
|
- name: Install oneTBB
|
|
shell: cmd
|
|
run: |
|
|
cd %GITHUB_WORKSPACE%
|
|
git clone https://github.com/Microsoft/vcpkg.git
|
|
cd vcpkg
|
|
cmd /c bootstrap-vcpkg.bat -disableMetrics
|
|
.\vcpkg.exe install tbb:${{matrix.vcpkgtriplet}}
|
|
copy installed\${{matrix.vcpkgtriplet}}\lib\tbb12.lib %GITHUB_WORKSPACE%
|
|
copy installed\${{matrix.vcpkgtriplet}}\bin\tbb12.dll %GITHUB_WORKSPACE%
|
|
- name: Install libcuckoo
|
|
shell: cmd
|
|
run: |
|
|
cd %GITHUB_WORKSPACE%
|
|
git clone https://github.com/efficient/libcuckoo.git libcuckoo-root
|
|
- name: Install gtl
|
|
shell: cmd
|
|
run: |
|
|
cd %GITHUB_WORKSPACE%
|
|
git clone https://github.com/greg7mdp/gtl.git gtl-root
|
|
- name: Compile
|
|
shell: cmd
|
|
run: |
|
|
cd %GITHUB_WORKSPACE%
|
|
# call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.architecture}}
|
|
call "C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" ${{matrix.architecture}}
|
|
set INCLUDE=%INCLUDE%;%GITHUB_WORKSPACE%\boost_unordered-root\include;%GITHUB_WORKSPACE%\boost-root;%GITHUB_WORKSPACE%\vcpkg\installed\${{matrix.vcpkgtriplet}}\include;%GITHUB_WORKSPACE%\libcuckoo-root\libcuckoo;%GITHUB_WORKSPACE%\gtl-root\include
|
|
echo %INCLUDE%
|
|
${{matrix.compiler}} ${{matrix.sourcefile}} ${{matrix.compileroptions}}
|
|
- name: Set reportfile name
|
|
shell: powershell
|
|
run: |
|
|
echo "REPORT_FILE=${{matrix.reportdir}}\${{matrix.sourcefile}}.txt" >> $env:GITHUB_ENV
|
|
- name: Run benchmark
|
|
shell: powershell
|
|
run: |
|
|
echo "running benchmarks and saving to $env:REPORT_FILE"
|
|
./${{matrix.outputfile}} | Set-Content $env:REPORT_FILE -Passthru
|
|
- name: Push benchmark results to repo
|
|
shell: powershell
|
|
run: |
|
|
git config --global user.name 'joaquintides'
|
|
git config --global user.email 'joaquintides@users.noreply.github.com'
|
|
git add $env:REPORT_FILE
|
|
git stash -- $env:REPORT_FILE
|
|
git pull
|
|
git stash pop
|
|
git add $env:REPORT_FILE
|
|
git commit -m "updated benchmark results"
|
|
git push
|
|
|
|
final:
|
|
needs: [posix,windows]
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install Python2
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '2.7.18'
|
|
- 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 user.name 'joaquintides'
|
|
git config --global user.email 'joaquintides@users.noreply.github.com'
|
|
git commit -am "updated README.md"
|
|
git push
|