aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xazalea-nbt/benches/my_benchmark.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/azalea-nbt/benches/my_benchmark.rs b/azalea-nbt/benches/my_benchmark.rs
index 7b44d610..df619c3d 100755
--- a/azalea-nbt/benches/my_benchmark.rs
+++ b/azalea-nbt/benches/my_benchmark.rs
@@ -29,12 +29,14 @@ fn bench_serialize(filename: &str, c: &mut Criterion) {
group.throughput(Throughput::Bytes(decoded_src.len() as u64));
// idk if this is criterion's fault or rust's fault but the async benchmark doesn't compile
- // group.bench_function("Decode", |b| {
- // b.to_async(tokio::runtime::Runtime::new().unwrap();).iter(|| async {
- // decoded_src_stream.seek(SeekFrom::Start(0)).unwrap();
- // Tag::read(&mut decoded_src_stream).await.unwrap();
- // })
- // });
+ group.bench_function("Decode", |b| {
+ b.to_async(tokio::runtime::Runtime::new().unwrap())
+ .iter(|| async {
+ let mut owned_decoded_src_stream = decoded_src_stream.clone();
+ owned_decoded_src_stream.seek(SeekFrom::Start(0)).unwrap();
+ Tag::read(&mut owned_decoded_src_stream).await.unwrap();
+ })
+ });
group.bench_function("Encode", |b| {
b.iter(|| {