owengage / fastnbt

Fast serde serializer and deserializer for Minecraft's NBT and Anvil formats
MIT License
185 stars 35 forks source link

[performance test] just a simple test #98

Closed shenjackyuanjie closed 7 months ago

shenjackyuanjie commented 7 months ago

https://github.com/shenjackyuanjie/nbt-rust/tree/main/crates/shen-nbt2

I and @InfyniteHeap write anther "Really fast nbt paser" with only 2x of memory usage (5GB file will use 10GB of memory)

v2

file size: 5761926813
10 0

===local nbt===
time: 2.4758987s
speed: 2327206203.145549 (bytes/sec)
2272662.307759325 (kb/sec)
2219.396784921216 (mb/sec)
2.167379672774625 (gb/sec)

v1 and fastnbt 2.4.4

file size: 5761926813
===local nbt===
time: 10.3387845s
speed: 557311820.6497099 (bytes/sec)
544249.8248532324 (kb/sec)
531.4939695832347 (mb/sec)
===fastnbt===
time: 5.0298196s
speed: 1145553373.922198 (bytes/sec)
1118704.4667208965 (kb/sec)
1092.4848307821255 (mb/sec)
owengage commented 7 months ago

This looks interesting. Can you share your benchmarking method and code?

shenjackyuanjie commented 7 months ago

the parser it's self is done, but the testing code and some other equipment is merging, I will give more information after I finish them

shenjackyuanjie commented 7 months ago

This looks interesting. Can you share your benchmarking method and code?

for now, you can checkout this file, it's a zip file, the unzip size is about 5GB (5761926813 for exact), this is the benchmarking file, just read it, and parse it.

shenjackyuanjie commented 5 months ago

Hi! I'm back with shen-nbt5 https://crates.io/crates/shen-nbt5

it's about 2.4gb/s parsing speed but it dosen't support serde for now so if any one like to open a PR for it, I'll be pleased