From 39b68ea7252cf9b35473559255640a06b8a37406 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 13 May 2024 11:47:05 +0000 Subject: [PATCH] add some inlines for writing --- simdnbt/README.md | 4 ++-- simdnbt/src/owned/mod.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/simdnbt/README.md b/simdnbt/README.md index c5104bf..b1e8d79 100644 --- a/simdnbt/README.md +++ b/simdnbt/README.md @@ -90,9 +90,9 @@ And for writing `complex_player.dat`: | Library | Throughput | | --------------- | ------------ | -| simdnbt::borrow | 2.4670 GiB/s | +| simdnbt::borrow | 2.6116 GiB/s | +| simdnbt::owned | 2.5033 GiB/s | | azalea_nbt | 2.4152 GiB/s | -| simdnbt::owned | 1.9660 GiB/s | | graphite_binary | 1.8804 GiB/s | The tables above were made from the [compare benchmark](https://github.com/azalea-rs/simdnbt/tree/master/simdnbt/benches) in this repo. diff --git a/simdnbt/src/owned/mod.rs b/simdnbt/src/owned/mod.rs index d7760b9..42a0960 100644 --- a/simdnbt/src/owned/mod.rs +++ b/simdnbt/src/owned/mod.rs @@ -279,6 +279,7 @@ impl NbtTag { /// /// This function is unsafe because it doesn't check that there's enough space in the data. /// 4 bytes MUST be reserved before calling this function. + #[inline] unsafe fn unchecked_write_without_tag_type(&self, data: &mut Vec) { match self { NbtTag::Byte(byte) => unsafe {