Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NBT indexer for reading large NBT data efficiently #127

Open
dktapps opened this issue Jan 9, 2025 · 0 comments
Open

NBT indexer for reading large NBT data efficiently #127

dktapps opened this issue Jan 9, 2025 · 0 comments

Comments

@dktapps
Copy link
Member

dktapps commented Jan 9, 2025

One of the annoying properties of NBT is that the entire thing has to be parsed in order to know how long it is, because a length prefix usually isn't included where it's used.

It's also very annoying to need to decode an entire NBT file (sometimes many MBs of data) just to get at perhaps a specific data key.

It would be nice to introduce an NbtIndexer that would take an input file and build an index of where to find all the tags in it, instead of decoding all those tags directly into objects. Then, when a specific subset of the data wants to be accessed, it would lookup the byte offset in the index, and then deserialize only that specific part of the file.

This would mainly be useful for processing large amounts of data when only a small amount of it is actually wanted.

It's not currently clear to me how useful this would actually be in terms of performance, but it's an experiment I thought might be worth someone's time to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant