Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/scripts/run-benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,16 @@ if not memory_rows:
sys.exit(1)

if not dictionary_rows:
print("WARN: No REPORT_DICT lines parsed; dictionary section will be empty.", file=sys.stderr)
print(
"WARN: No REPORT_DICT lines parsed; dictionary section has no data rows; writing _n/a_ placeholder.",
file=sys.stderr,
)

if not dictionary_training_rows:
print(
"ERROR: No REPORT_DICT_TRAIN lines parsed; dictionary training section would be empty.",
"WARN: No REPORT_DICT_TRAIN lines parsed; dictionary training section has no data rows; writing _n/a_ placeholder.",
file=sys.stderr,
)
sys.exit(1)

with open("benchmark-results.json", "w") as f:
json.dump(benchmark_results, f, indent=2)
Expand Down Expand Up @@ -482,6 +484,8 @@ for row in sorted(dictionary_rows, key=lambda item: (item["scenario"], item["lev
lines.append(
f'| {row["scenario"]} | {label} | {row["level"]} | {row["dict_bytes"]} | {row["train_ms"]:.3f} | {row["ffi_no_dict_bytes"]} | {row["ffi_with_dict_bytes"]} | {row["ffi_no_dict_ratio"]:.4f} | {row["ffi_with_dict_ratio"]:.4f} |'
Comment thread
polaz marked this conversation as resolved.
)
if not dictionary_rows:
lines.append("| _n/a_ | _no dictionary rows emitted in this run_ | - | - | - | - | - | - | - |")
Comment thread
coderabbitai[bot] marked this conversation as resolved.

lines.extend([
"",
Expand All @@ -498,6 +502,8 @@ for row in sorted(dictionary_training_rows, key=lambda item: item["scenario"]):
lines.append(
f'| {row["scenario"]} | {label} | {row["dict_bytes_requested"]} | {row["rust_train_ms"]:.3f} | {row["ffi_train_ms"]:.3f} | {row["rust_dict_bytes"]} | {row["ffi_dict_bytes"]} | {row["rust_fastcover_score"]} | {delta_cell} | {row["status"]} |'
)
if not dictionary_training_rows:
lines.append("| _n/a_ | _no dictionary training rows emitted in this run_ | - | - | - | - | - | - | - | - |")

lines.extend([
"",
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,25 @@ jobs:
fail-on-alert: ${{ github.event_name == 'pull_request' }}
save-data-file: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
benchmark-data-dir-path: dev/bench

- name: Checkout gh-pages
if: steps.bot-token.outputs.token != '' && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/checkout@v6
with:
ref: gh-pages
token: ${{ steps.bot-token.outputs.token }}
path: gh-pages

- name: Publish benchmark reports to gh-pages
if: steps.bot-token.outputs.token != '' && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdir -p gh-pages/dev/bench
cp benchmark-report.md gh-pages/dev/bench/benchmark-report.md
cp benchmark-delta.json gh-pages/dev/bench/benchmark-delta.json
cp benchmark-delta.md gh-pages/dev/bench/benchmark-delta.md
cd gh-pages
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add dev/bench/benchmark-report.md dev/bench/benchmark-delta.json dev/bench/benchmark-delta.md
git diff --cached --quiet || git commit -m "chore(bench): publish benchmark reports"
git push origin gh-pages
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Pure Rust zstd implementation — managed fork of [ruzstd](https://github.com/Ki
Historical benchmark charts are published to GitHub Pages:

- [Performance dashboard](https://structured-world.github.io/structured-zstd/dev/bench/)
- [Latest benchmark delta report](https://structured-world.github.io/structured-zstd/dev/bench/benchmark-delta.md)
- [Latest full benchmark report](https://structured-world.github.io/structured-zstd/dev/bench/benchmark-report.md)

Note: the root Pages URL can be empty; benchmark charts live under `/dev/bench/`.

Expand Down
Loading