Skip to content

Commit

Permalink
Merge pull request #179 from sval-rs/chore/json-bench-updates
Browse files Browse the repository at this point in the history
Add a benchmark for collecting to owned sval values
  • Loading branch information
KodrAus authored Oct 5, 2023
2 parents 25ca8fd + 17bd7ab commit 2c2fcde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion json/bench/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,13 @@ fn twitter_serde_to_sval_to_serde(b: &mut test::Bencher) {
#[bench]
fn twitter_sval_collect(b: &mut test::Bencher) {
let s = input_struct();
b.iter(|| sval_buffer::Value::collect(&s));
b.iter(|| sval_buffer::Value::collect(&s).unwrap());
}

#[bench]
fn twitter_sval_collect_owned(b: &mut test::Bencher) {
let s = input_struct();
b.iter(|| sval_buffer::Value::collect(&s).unwrap().into_owned().unwrap());
}

#[bench]
Expand Down

0 comments on commit 2c2fcde

Please sign in to comment.