mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-28 03:05:04 -06:00
57b2a713a1
The result will always be the same, and on multiple calls to
rego.New() with the wasm target, repeating this work can be
avoided.
A quick benchmark shows this in action, first main, then this
branch:
BenchmarkWasmCompilation-16 133 8345008 ns/op 7521141 B/op 28041 allocs/op
BenchmarkWasmCompilation-16 256 4529514 ns/op 3666712 B/op 27670 allocs/op
Once Go 1.17 is out and we can do something incompatible with
1.15, we can switch to using the go:embed directive instead.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>