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:
Steven Masley
2023-02-10 08:39:45 -06:00
committed by GitHub
parent ab9cba9396
commit 32fbd10a1f
5 changed files with 51 additions and 25 deletions

View File

@ -977,9 +977,14 @@ func testAuthorize(t *testing.T, name string, subject Subject, sets ...[]authTes
d, _ := json.Marshal(map[string]interface{}{
// This is not perfect marshal, but it is good enough for debugging this test.
"subject": subject,
"object": c.resource,
"action": a,
"subject": authSubject{
ID: subject.ID,
Roles: must(subject.Roles.Expand()),
Groups: subject.Groups,
Scope: must(subject.Scope.Expand()),
},
"object": c.resource,
"action": a,
})
// Logging only