Replaces the derived Deserialize implementation for est::Expr with a custom one, resulting in greatly improved performance on the #1284 benchmark (see #1307). Should be a performance improvement for a wide variety of invalid est::Exprs. Hopefully not a slowdown for the happy path, that is, valid est::Exprs.
On my machine, the new numbers for the #1284 benchmark are:
Policy::from_json time: [107.54 µs 107.61 µs 107.70 µs]
change: [-99.997% -99.997% -99.997%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
1 (1.00%) low mild
3 (3.00%) high mild
2 (2.00%) high severe
That is, performance has improved from about 3.4s to execute once, to about 108 µs.
Issue #, if available
Fixes #1284.
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
[x] A bug fix or other functionality change requiring a patch to cedar-policy.
I confirm that this PR (choose one, and delete the other options):
[x] Does not update the CHANGELOG because my change does not significantly impact released code.
I confirm that cedar-spec (choose one, and delete the other options):
[x] Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.
Description of changes
Replaces the derived
Deserialize
implementation forest::Expr
with a custom one, resulting in greatly improved performance on the #1284 benchmark (see #1307). Should be a performance improvement for a wide variety of invalidest::Expr
s. Hopefully not a slowdown for the happy path, that is, validest::Expr
s.On my machine, the new numbers for the #1284 benchmark are:
That is, performance has improved from about 3.4s to execute once, to about 108 µs.
Issue #, if available
Fixes #1284.
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy
.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):