azalea-rs / azalea

A collection of Rust crates for making Minecraft bots, clients, and tools.
https://azalea.matdoes.dev
MIT License
403 stars 50 forks source link

NBT decoder optimizations #17

Closed mat-1 closed 2 years ago

mat-1 commented 2 years ago

Use AHash for HashMaps and make read_string read everything at once. I'm sure more optimizations are possible here but I don't know how to execute them. I also know I could make it way faster if it was a &[u8] instead of a Read, but it is, so I have to figure out how to optimize with that.

mat-1 commented 2 years ago

i can't come up with better optimizations so I'm merging it like this