Benchmark Rego query
rego_benchBenchmark Rego queries against policies and inputs to identify slow rules with timing and allocation statistics.
Instructions
Benchmark a Rego query against a policy + input with opa bench. Returns statistical timing data: iterations, ns/op, and allocation counts. Use this to spot slow rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of times to repeat the benchmark (`--count N`). Defaults to OPA's built-in default of one. Every repetition is returned in `runs`; the top-level figures come from the fastest of them. | |
| input | No | Inline input document. | |
| paths | No | Policy / data paths to load. Each must be in an allowed root. | |
| query | Yes | Rego query to benchmark. | |
| inputPath | No | Path to a JSON input file. |