Skip to content

Commit

Permalink
add a benchmark for collecting to owned sval values
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Oct 4, 2023
1 parent 25ca8fd commit 17bd7ab
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 17bd7ab

Please sign in to comment.