Skip to content

Commit

Permalink
borrow hugr
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Aug 16, 2024
1 parent ce5cb32 commit 1582db3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hugr/benches/benchmarks/hugr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Serializer for JsonSer {
}
}

fn roundtrip(hugr: Hugr, serializer: impl Serializer) -> Hugr {
fn roundtrip(hugr: &Hugr, serializer: impl Serializer) {
let bytes = serializer.serialize(&hugr);
serde_json::from_slice(&bytes).unwrap()
}
Expand Down Expand Up @@ -160,7 +160,7 @@ fn bench_serialization(c: &mut Criterion) {
c.bench_function("simple_cfg_serialize", |b| {
let h = simple_cfg_hugr();
b.iter(|| {
black_box(roundtrip(h.clone(), JsonSer));
black_box(roundtrip(&h, JsonSer));
});
});
let mut group = c.benchmark_group("circuit_serialize");
Expand All @@ -169,7 +169,7 @@ fn bench_serialization(c: &mut Criterion) {
group.bench_with_input(BenchmarkId::from_parameter(size), size, |b, &size| {
let h = circuit(size);
b.iter(|| {
black_box(roundtrip(h.clone(), JsonSer));
black_box(roundtrip(&h, JsonSer));
});
});
}
Expand Down

0 comments on commit 1582db3

Please sign in to comment.