mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: Optimize parial rego execution byte allocations (#6144)
* chore: Implement benchmark for authorizer.Prepare Identify time + alloc cost before optimizing
This commit is contained in:
@ -51,7 +51,11 @@ func BenchmarkRBACValueAllocation(b *testing.B) {
|
||||
})
|
||||
b.Run("JSONRegoValue", func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := ast.InterfaceToValue(jsonSubject)
|
||||
_, err := ast.InterfaceToValue(map[string]interface{}{
|
||||
"subject": jsonSubject,
|
||||
"action": ActionRead,
|
||||
"object": obj,
|
||||
})
|
||||
require.NoError(b, err)
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user