Skip to content
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

Add client.AddTemplate benchmarks #151

Closed
willbeason opened this issue Nov 15, 2021 · 1 comment · Fixed by #159
Closed

Add client.AddTemplate benchmarks #151

willbeason opened this issue Nov 15, 2021 · 1 comment · Fixed by #159
Assignees

Comments

@willbeason
Copy link
Member

Add two benchmarks for compiling ConstraintTemplate: one simple template, and one complex template.

For the simple CT (and the general benchmarking code), I recommend looking at this code. See BenchmarkClient_AddTemplate and makeModule.

For the simple CT, we're trying to find the answer to the question of "What is the largest number of CTs a user could possibly have?"

For the complex CT, find a reasonably complex one from the gatekeeper-library. It doesn't particularly matter which one - so long as it looks complex. The idea is to answer the question "What is the largest number of normal CTs a user can have?"

It'd be best for this to live in its own test file - maybe addtemplate_benchmark_test.go?

@willbeason willbeason added this to the Rego Environment Sharding milestone Nov 15, 2021
@willbeason willbeason changed the title Add AddTemplate benchmarks Add client.AddTemplate benchmarks Nov 15, 2021
@willbeason willbeason self-assigned this Nov 15, 2021
willbeason pushed a commit to willbeason/frameworks that referenced this issue Nov 15, 2021
Fixes open-policy-agent#151

Signed-off-by: Will Beason <willbeason@google.com>
@maxsmythe
Copy link
Contributor

willbeason pushed a commit that referenced this issue Nov 23, 2021
* Add benchmarks for client.AddTemplate

Fixes #151

Signed-off-by: Will Beason <willbeason@google.com>

* Refactor to make module set accesible for other benchmarks

Signed-off-by: Will Beason <willbeason@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants