Benchmark #33
This file contains 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: Benchmark | |
on: | |
workflow_dispatch: | |
permissions: {} | |
jobs: | |
benchmark: | |
permissions: | |
contents: read | |
packages: read | |
runs-on: ubuntu-22.04 | |
env: | |
HASH_LIST: "mmh3_32 mmh3_128 xxh_32 xxh_64 xxh3_64 xxh3_128 md5 sha1" | |
BENCHMARK_MAX_SIZE: 2097152 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install . | |
pip install ".[benchmark]" | |
- name: Benchmark hash functions | |
run: | | |
mkdir var | |
for hash_name in "${HASH_LIST[@]}"; do | |
python benchmark/benchmark.py -o var/${hash_name}.json \ | |
--test-hash ${hash_name} \ | |
--test-buffer-size-max ${{ env.BENCHMARK_MAX_SIZE }} | |
done | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: benchmark-results | |
path: var |