-
Notifications
You must be signed in to change notification settings - Fork 1.5k
inmem: allow passing triggers (AST) data without conversion #7959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inmem: allow passing triggers (AST) data without conversion #7959
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This pull request has been automatically marked as stale because it has not had any activity in the last 30 days. |
sspaink
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
|
|
||
| for _, t := range db.triggers { | ||
| t.OnCommit(ctx, txn, event) | ||
| if wantsDataConversion && !t.SkipDataConversion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if wantsDataConversion && !t.SkipDataConversion { | |
| if !t.SkipDataConversion { |
Using wantsDataConversion seems unnecessary here, because it will be true if !t.SkipDataConversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I'll change that, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that turned out to be not true after all, as wantsDataConversion depended on more conditions above.
v1/storage/inmem/inmem_bench_test.go
Outdated
|
|
||
| // Go 48750 ns/op 27040 B/op 311 allocs/op (no additional cost of triggers) | ||
| // AST 191501 ns/op 37585 B/op 616 allocs/op (extra cost du to converting back to Go values.. why?) | ||
| // AST 191501 ns/op 37585 B/op 616 allocs/op (extra cost du to converting back to Go values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // AST 191501 ns/op 37585 B/op 616 allocs/op (extra cost du to converting back to Go values) | |
| // AST 191501 ns/op 37585 B/op 616 allocs/op (extra cost due to converting back to Go values) |
8fe54c8 to
3c16c07
Compare
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Fixes open-policy-agent#7958 Signed-off-by: Anders Eknert <[email protected]>
3c16c07 to
8c0f368
Compare

Fixes #7958