Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cedar-policy/benches/attr_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#![allow(clippy::unwrap_used)]
use cedar_policy::EntityUid;
use cedar_policy::{Authorizer, Context, Entities, PolicySet, Request, RestrictedExpression};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};
use std::hint::black_box;
use std::str::FromStr;

const LARGE_SIZE: usize = 100_000;
Expand Down
4 changes: 2 additions & 2 deletions cedar-policy/benches/cedar_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
// PANIC SAFETY benchmarking
#![allow(clippy::expect_used)]

use std::str::FromStr;
use std::{hint::black_box, str::FromStr};

use cedar_policy::{
Authorizer, Context, Entities, EntityId, EntityTypeName, EntityUid, Policy, PolicySet, Request,
RestrictedExpression,
};

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};

pub fn criterion_benchmark(c: &mut Criterion) {
let auth = Authorizer::new();
Expand Down
4 changes: 3 additions & 1 deletion cedar-policy/benches/deeply_nested_est.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
* limitations under the License.
*/

use std::hint::black_box;

use cedar_policy::Policy;

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};

// PANIC SAFETY: benchmarking
#[allow(clippy::unwrap_used)]
Expand Down
3 changes: 2 additions & 1 deletion cedar-policy/benches/entity_attr_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
use cedar_policy::{
Authorizer, Context, Entities, Entity, EntityUid, PolicySet, Request, RestrictedExpression,
};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};
use std::{
collections::{HashMap, HashSet},
hint::black_box,
str::FromStr,
};

Expand Down
4 changes: 2 additions & 2 deletions cedar-policy/benches/entity_parsing.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// PANIC SAFETY: it's ok for benchmarking code to panic
#![allow(clippy::unwrap_used)]

use std::str::FromStr;
use std::{hint::black_box, str::FromStr};

use cedar_policy::EntityTypeName;

use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};

fn entity_type_name_parsing(c: &mut Criterion) {
let mut group = c.benchmark_group("EntityTypeName parsing");
Expand Down
4 changes: 2 additions & 2 deletions cedar-policy/benches/extension_fn_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

use std::str::FromStr;
use std::{hint::black_box, str::FromStr};

use cedar_policy::{Policy, PolicySet, Schema, Validator};

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion::{criterion_group, criterion_main, Criterion};

// PANIC SAFETY: benchmarking
#[allow(clippy::unwrap_used)]
Expand Down