1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

fix nbt decode benchmark

This commit is contained in:
mat 2022-04-22 00:52:22 -05:00
parent 1bbd8b99b3
commit 67c6e33344

View file

@ -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(|| {