aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xazalea-nbt/benches/my_benchmark.rs26
-rwxr-xr-xazalea-nbt/src/decode.rs1
2 files changed, 14 insertions, 13 deletions
diff --git a/azalea-nbt/benches/my_benchmark.rs b/azalea-nbt/benches/my_benchmark.rs
index 528475d3..00d12dc8 100755
--- a/azalea-nbt/benches/my_benchmark.rs
+++ b/azalea-nbt/benches/my_benchmark.rs
@@ -29,20 +29,20 @@ fn bench_serialize(filename: &str, c: &mut Criterion) {
group.throughput(Throughput::Bytes(decoded_src.len() as u64));
- // 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(|| {
- nbt.write(&mut io::sink()).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(|| {
+ // nbt.write(&mut io::sink()).unwrap();
+ // })
+ // });
group.finish();
}
diff --git a/azalea-nbt/src/decode.rs b/azalea-nbt/src/decode.rs
index e4968811..3e2f7adb 100755
--- a/azalea-nbt/src/decode.rs
+++ b/azalea-nbt/src/decode.rs
@@ -21,6 +21,7 @@ where
}
impl Tag {
+ #[inline]
#[async_recursion]
async fn read_known<R>(stream: &mut R, id: u8) -> Result<Tag, Error>
where