Ars Nouveau

Ars Nouveau

49M Downloads

Storage Lectern causing massive client lag due to constantly sorting Apotheosis items

pollyzoid opened this issue ยท 1 comments

commented

Versions

  • Minecraft 1.19.2
  • Ars Nouveau 3.23.0

Modpack: Enigmatica 9, v1.21.0

Storage Lectern, when connected to a Functional Storage Armory Cabinet containing 500+ items with NBT data (including Apotheosis affixes), causes large amounts of lag when browsing the items. May happen with other containers, but due to the nature of this case it's hard to reproduce in a new world with my limited Minecraft knowledge.
Based on the profiler output, this is rooted in AbstractStorageTerminalScreen sorting the item list every tick, probably due to refreshItemList being set to true in render() (or receive?). This may have been unnoticeable in most cases, but here it's hitting JSON decoding via StoredItemStack$ComparatorAmount.compare() -> ItemStack.getHoverName() -> mixin apoth_affixItemName(). While Apotheosis probably shouldn't be doing JSON decoding in this method (and I plan to report this), Lectern sorting almost every tick seems like it should be fixed.

Theoretical repro:

  1. Lectern, Armory Cabinet (or another large container), link them
  2. Insert ~500 items with Apotheosis affixes (non-stacking) into Cabinet
  3. Browse via Lectern

Workaround: hold Shift to browse without stuttering (or don't use Apotheosis / hoard random mob drops I guess).

Profile: https://spark.lucko.me/ydCYeLPeUr

commented

This is fixed in the latest version.