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

Add a serializer flag to force ordering of TAG_Compound keys #120

Open
dktapps opened this issue May 1, 2023 · 0 comments
Open

Add a serializer flag to force ordering of TAG_Compound keys #120

dktapps opened this issue May 1, 2023 · 0 comments

Comments

@dktapps
Copy link
Member

dktapps commented May 1, 2023

It may be desirable to keep an encoded binary cache of an NBT tree, to be able to do fast bytewise comparison (such comparisons are vectorizable, and as such, considerably faster than making many thousands of equals() method calls).

However, this is currently not a reliable method of comparison, since TAG_Compounds with the same contents can have said contents ordered differently. This doesn't affect the usability of the data in the end, but it does mean that the binary representation would be different.

Use case: I want to have a fast way to compare itemstack NBT when checking item equivalence.

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

No branches or pull requests

1 participant