azalea/azalea-nbt
mat 0bf8291388 check for entity duplication before spawning
this fixes behavior where in swarms entities in the world might sometimes have a duplicate that gets spawned and despawned immediately
2023-09-28 21:57:36 -05:00
..
benches add basic pathfinding test 2023-08-25 02:34:31 -05:00
src 1.20.2 (#99) 2023-09-21 11:16:29 -05:00
tests simd number arrays 2023-03-23 20:20:13 -05:00
Cargo.toml check for entity duplication before spawning 2023-09-28 21:57:36 -05:00
README.md nbt lookup optimization 2023-03-23 19:38:18 +00:00

Azalea NBT

A fast NBT serializer and deserializer.

  • Gzip and Zlib compression
  • All data is owned for ease-of-use
  • Serde support with the serde feature.

Examples

use azalea_nbt::{Nbt, NbtCompound};
use std::io::Cursor;

let buf = include_bytes!("../tests/hello_world.nbt");
let tag = Nbt::read(&mut Cursor::new(&buf[..])).unwrap();
assert_eq!(
    tag,
    Nbt::Compound(NbtCompound::from_iter(vec![(
        "hello world".into(),
        Nbt::Compound(NbtCompound::from_iter(vec![(
            "name".into(),
            Nbt::String("Bananrama".into()),
        )]))
    )]))
);

Benchmarks

At the time of writing, Azalea NBT is the fastest NBT decoder (approximately twice as fast as Graphite NBT, the second fastest) and on-par with the fastest NBT encoders (sometimes the fastest, depending on the data).

You can run the benchmarks to compare against other NBT libraries with cargo bench --bench compare and the normal benchmarks with cargo bench --bench nbt.

Note: For best performance, use RUSTFLAGS='-C target-cpu=native'.