mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
43590a4f19
Seeing the performance comparison of Regorus and OPA in the Regorus [docs](https://github.com/microsoft/regorus?tab=readme-ov-file#performance) made me curious to try it out myself. This PR adds the test files from their repo (MIT licensed) and two benchmark tests that evaluates the policy using the same parameters as the `opa eval` command from their example. The benchmarks show that doing the full `opa eval` dance where we build/compile the bundle from scratch is about as fast/slow as their example shows (~30 milliseconds here, but that's without the overhead of the eval command line tool). However, building the bundle and query beforehand — as would be done in the case of a real OPA deployment — and measuring only _evaluation time_, shows something else entirely: ~0.09 milliseconds, or 90 microseconds. So while the numbers they present aren't misleading in any way, they're not representative of OPA's evaluation performance as experiences running OPA as a server, or through the Go API. That they compile the bundle in that short time is impressive nonetheless! Saving the benchmark here as it's a good one to use for future improvements. Signed-off-by: Anders Eknert <anders@styra.com>