forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
genopawasm: only unpack wasm and callgraph bytes once (open-policy-ag…
…ent#3644) 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 <[email protected]>
- Loading branch information
Showing
2 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters