cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
889 stars 80 forks source link

Add benchmark for 1284 #1307

Closed cdisselkoen closed 2 weeks ago

cdisselkoen commented 2 weeks ago

Description of changes

Adds another criterion benchmark, this one demonstrating the problem in #1284. That way we can evaluate potential (full or partial) fixes to #1284 by how much they improve this benchmark. Here are the current results on my machine:

Policy::from_json       time:   [3.3987 s 3.3995 s 3.4004 s]
Found 11 outliers among 100 measurements (11.00%)
  2 (2.00%) low mild
  5 (5.00%) high mild
  4 (4.00%) high severe

Takes about 3.4s to execute the benchmark once, confirming the finding in #1284; this is much too long.

Issue #, if available

1284

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):