Skip to content

add 3 new "improvements": to SuffixArray, to UnihexProvider, and for compacting the lists made in BlockModels - #192

Open
AnAwesomGuy wants to merge 3 commits into
malte0811:1.21.0from
AnAwesomGuy:1.21.0
Open

add 3 new "improvements": to SuffixArray, to UnihexProvider, and for compacting the lists made in BlockModels#192
AnAwesomGuy wants to merge 3 commits into
malte0811:1.21.0from
AnAwesomGuy:1.21.0

Conversation

@AnAwesomGuy

Copy link
Copy Markdown

honestly these shouldnt save a crazy amount of ram, the SuffixArray one should save around ~12 MB in a decent sized modpack (it halves the size of a field in SuffixArray), and the UnihexProvider and BlockModel ones should each save a couple MB

basically what they each do:

  • SuffixArray: makes chars a CharList instead of an IntList, halving the memory footprint. normally, only chars are inserted with -1 meaning the end of a string, but when using a CharList, -1 is replaced with\u0000 (null char).
  • UnihexProvider: compacts the glyphs in UnihexProvider to use flat fields instead of arrays. for example, in ByteContents, instead of using a 16-length byte array, it uses two long fields. (i didnt do the int ones as those are not commonly used)
  • BlockModel: creates immutable copy of the Lists in BlockModel (the overrides are especially affected by this as they are usually empty) and so it reduces the amount of empty ArrayLists.

feel free to just merge parts of this or not merge it at all. also, CodepointMap should definitely be optimized but idk how to do that lol.

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

Successfully merging this pull request may close these issues.

1 participant