Skip to content

the standard slide_hash implementation vectorizes well on avx2 #111

the standard slide_hash implementation vectorizes well on avx2

the standard slide_hash implementation vectorizes well on avx2 #111

Workflow file for this run

name: Benchmark
permissions:
contents: read
on:
push:
branches:
- main
workflow_dispatch:
inputs:
ref:
description: "The commit or branch to benchmark"
required: true
type: string
merge_group:
branches:
- main
# Make sure only a single benchmark job runs at a time for the main branch to prevent conflicts when
# pushing the benchmark data.
concurrency:
group: "benchmarking-${{inputs.ref}}"
cancel-in-progress: false
jobs:
bench:
name: "Benchmark ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
include:
- name: linux-x86
os: [benchmark, X64]
target: "x86_64-unknown-linux-gnu"
- name: macos-arm64
os: [benchmark, ARM64, macOS]
target: "aarch64-apple-darwin"
steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: false
ref: "${{inputs.ref}}"
fetch-depth: 0 # ensure the base commit to compare against is available
- name: cargo build
env:
RUSTFLAGS: "-Cllvm-args=-enable-dfa-jump-thread"
run: |
. "$HOME/.cargo/env"
cargo build --target ${{matrix.target}} -p test-libz-rs-sys --release --examples
cp target/${{matrix.target}}/release/examples/blogpost-compress .
cp target/${{matrix.target}}/release/examples/blogpost-uncompress .
# switch the C implementation from zlib-ng to zlib-chromium
# sed on macOS is a bit annoying
if sed --version 2>/dev/null | grep -q GNU; then
sed -i '/^libz-sys =/c\libz-sys = { git = "https://github.com/folkertdev/libz-chromium-sys", rev = "4671e8e16bf277d06ff2397e3091db3515c6f934", default-features = false, features = ["zlib-ng"] }' Cargo.toml
else
printf '%s\n' '/^libz-sys =/c\' 'libz-sys = { git = "https://github.com/folkertdev/libz-chromium-sys", rev = "4671e8e16bf277d06ff2397e3091db3515c6f934", default-features = false, features = ["zlib-ng"] }' | sed -i '' -f - Cargo.toml
fi
cargo build --target ${{matrix.target}} -p test-libz-rs-sys --release --examples
cp target/${{matrix.target}}/release/examples/blogpost-compress blogpost-compress-chromium
cp target/${{matrix.target}}/release/examples/blogpost-uncompress blogpost-uncompress-chromium
- name: Benchmark
uses: trifectatechfoundation/benchmarker-action@main
with:
deploy-key: "${{ secrets.BENCH_DATA_DEPLOY_KEY }}"
bench-repo: "git@github.com:trifectatechfoundation/zlib-rs-bench.git"
metric-key: "${{ matrix.name }}"
benchmarks: "zlib_benchmarks.json"