Performance Benchmarks #8
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
| # Full throughput comparison (not a hard regression gate). HS256 ratio gates run in main CI via pytest smoke. | |
| name: Benchmarks | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 6 * * 1" | |
| permissions: | |
| contents: read | |
| jobs: | |
| compare: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: rust | |
| - name: Install Python dependencies | |
| run: | | |
| python3 -m venv .venv | |
| .venv/bin/python -m pip install -U pip maturin pytest cryptography pyjwt authlib python-jose | |
| - name: Build and install OxyJWT | |
| run: .venv/bin/maturin develop --release | |
| - name: HS256 smoke regression (same gate as main CI) | |
| run: .venv/bin/python -m pytest tests/test_benchmark_jwt_libraries.py::test_benchmark_hs256_smoke_vs_competitors -q | |
| - name: Run full comparison script (default pem keys) | |
| run: | | |
| mkdir -p benchmark-results | |
| .venv/bin/python scripts/compare_jwt_libraries.py \ | |
| --algorithms HS256,RS256,EdDSA \ | |
| --iterations 200 \ | |
| --rounds 2 \ | |
| --warmup 50 \ | |
| --markdown benchmark-results/ci-bench.md | |
| - name: Run asymmetric comparison (cached competitor keys) | |
| run: | | |
| .venv/bin/python scripts/compare_jwt_libraries.py \ | |
| --algorithms RS256,EdDSA \ | |
| --iterations 200 \ | |
| --rounds 2 \ | |
| --warmup 50 \ | |
| --competitor-key-mode cached \ | |
| --markdown benchmark-results/ci-bench-cached.md | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-md | |
| path: benchmark-results/ |