Complete reference for the bac-perf command-line tool.
cargo build --release --package perf-testing
The binary is at target/release/bac-perf.
Generate HBAC or ABAC rule fixtures for benchmarking.
bac-perf generate [OPTIONS]
Option Description Default
--bac-type <TYPE>BAC type: hbac or abac hbac
--count <N>Number of rules to generate required
--output <NAME>Output fixture name required
--distribution <PRESET>Distribution preset: sssd-prod, dev, high-security sssd-prod
--seed <N>Random seed for reproducibility 42
--fixtures-dir <PATH>Fixtures directory fixtures
# Generate HBAC fixture
bac-perf generate --bac-type hbac --count 1000 --output prod_1k \
--distribution sssd-prod --seed 42
# Generate ABAC fixture (same distributions)
bac-perf generate --bac-type abac --count 1000 --output abac_1k \
--distribution sssd-prod --seed 42
Run performance benchmarks against a fixture.
bac-perf bench [OPTIONS]
Option Description Default
--bac-type <TYPE>BAC type: hbac or abac hbac
--fixture <NAME>Fixture to benchmark required
--scenario <NAME>Benchmark scenario all
--cacheEnable caching disabled
--jitEnable JIT compilation (HBAC only, requires --features jit build) disabled
--format <FORMAT>Output format: terminal, json, csv, markdown terminal
--output <PATH>Save results to file stdout
--fixtures-dir <PATH>Fixtures directory fixtures
Scenarios:
Scenario Description
single-latencyRequest latency with warm cache (10K matching requests)
uncached-latencyRaw evaluation without cache benefit (10K unique requests)
throughputSustained load with 80/20 match/non-match mix
build-timePolicy load and index construction time
allRun all scenarios
# Benchmark HBAC
bac-perf bench --bac-type hbac --fixture prod_1k --scenario all --cache \
--format json --output results.json
# Benchmark ABAC using HBAC fixture (automatic conversion)
bac-perf bench --bac-type abac --fixture prod_1k --scenario all \
--format json --output abac_results.json
Note: ABAC can benchmark both ABAC and HBAC fixtures. When using an HBAC
fixture with --bac-type abac, rules are automatically converted from the
three-dimensional user/host/service model to the equivalent ABAC
user/resource/action dimensions. This enables direct performance comparison.
See Cross-BAC Benchmarking .
List available fixtures.
bac-perf list [OPTIONS]
Option Description Default
--verboseShow rule count, size, and generation date summary only
--fixtures-dir <PATH>Fixtures directory fixtures
bac-perf list --verbose
Compare two benchmark runs to detect regressions.
bac-perf compare <BASELINE> <CURRENT> [OPTIONS]
Argument Description
<BASELINE>Path to baseline JSON results
<CURRENT>Path to current JSON results
Option Description Default
--format <FORMAT>Output format: terminal, markdown terminal
bac-perf compare baseline.json current.json
Check fixture integrity (schema version, JSON structure, rule count
consistency).
bac-perf validate <FIXTURE> [OPTIONS]
Argument Description
<FIXTURE>Fixture name to validate
Option Description Default
--fixtures-dir <PATH>Fixtures directory fixtures
bac-perf validate prod_1k
Variable Description
BAC_PERF_FIXTURES_DIROverride the default fixtures directory
BAC_PERF_OUTPUT_FORMATOverride the default output format
export BAC_PERF_FIXTURES_DIR=/var/lib/bac-perf/fixtures
bac-perf list
Code Meaning
0 Success
1 General error (invalid arguments, file not found)
2 Validation error (fixture is invalid)
3 Benchmark error (evaluation failed)