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
22 changes: 13 additions & 9 deletions .github/scripts/run-benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ timing_point_count = 0
DELTA_LOW = 0.99
DELTA_HIGH = 1.05
REGRESSION_STAGES = {"compress", "decompress"}
REGRESSION_LEVELS = {"default", "better"}
REGRESSION_SCENARIOS = {
"small-4k-log-lines",
"decodecorpus-z000033",
Expand Down Expand Up @@ -162,10 +161,10 @@ def normalize_impl(impl):
return "ffi"
return impl

def include_in_regression_set(parsed_name):
def include_in_regression_set(parsed_name, regression_levels):
return (
parsed_name["stage"] in REGRESSION_STAGES
and parsed_name["level"] in REGRESSION_LEVELS
and parsed_name["level"] in regression_levels
and parsed_name["scenario"] in REGRESSION_SCENARIOS
)

Expand Down Expand Up @@ -199,12 +198,6 @@ with open(raw_path) as f:
timings.append((name, ms))
parsed = parse_benchmark_name(name)
timing_point_count += 1
if include_in_regression_set(parsed):
benchmark_results.append({
"name": name,
"unit": "ms",
"value": round(ms, 3),
})
timing_rows.append({
"name": name,
"stage": parsed["stage"],
Expand Down Expand Up @@ -320,6 +313,17 @@ if timing_point_count == 0:
print("ERROR: No benchmark timings parsed from compare_ffi output.", file=sys.stderr)
sys.exit(1)

regression_levels = {row["level"] for row in ratios}
benchmark_results = [
{
"name": row["name"],
"unit": "ms",
"value": round(row["ms_per_iter"], 3),
}
for row in timing_rows
if include_in_regression_set(row, regression_levels)
]

if not benchmark_results:
print(
"WARN: No regression-set benchmark rows matched smoke filter; "
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,22 @@ jobs:
benchmark:
name: Performance regression check (${{ matrix.bench.id }})
needs: lint
timeout-minutes: 40
timeout-minutes: ${{ matrix.bench.timeout_minutes }}
strategy:
fail-fast: false
matrix:
bench:
- id: x86_64-gnu
target_triple: x86_64-unknown-linux-gnu
timeout_minutes: 40
setup_command: ""
- id: i686-gnu
target_triple: i686-unknown-linux-gnu
timeout_minutes: 55
setup_command: "sudo apt-get update && sudo apt-get install -y gcc-multilib libc6-dev-i386"
- id: x86_64-musl
target_triple: x86_64-unknown-linux-musl
timeout_minutes: 40
setup_command: "sudo apt-get update && sudo apt-get install -y musl-tools"
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 7 additions & 1 deletion zstd/benches/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ pub(crate) fn benchmark_scenarios() -> Vec<Scenario> {
scenarios
}

pub(crate) fn supported_levels() -> [LevelConfig; 4] {
/// Benchmark levels mapped to comparable Rust and FFI compression settings.
pub(crate) fn supported_levels() -> [LevelConfig; 5] {
[
LevelConfig {
name: "fastest",
Expand All @@ -89,6 +90,11 @@ pub(crate) fn supported_levels() -> [LevelConfig; 4] {
rust_level: CompressionLevel::Better,
ffi_level: 7,
},
LevelConfig {
name: "level4-row",
rust_level: CompressionLevel::Level(4),
ffi_level: 4,
},
LevelConfig {
name: "best",
rust_level: CompressionLevel::Best,
Expand Down
Loading
Loading