SHsuperCM / CITResewn

Fabric implementation of mcpatcher's cit
MIT License
154 stars 76 forks source link

Lag on inventory GUI with lots of custom items #303

Closed rinnarii closed 11 months ago

rinnarii commented 11 months ago

I am playing Hypixel skyblock and when I open a custom GUI, for example the auction house, the fps will drop to an unplayable state. I think it's due to the custom items and lores having lots of data being scanned by the mod to generate custom item selection, since a normal chest with only few custom items does not lag. I can confirm its the mod because I removed the mod and it went back to normal fps when opening such GUIs.

I also found these as well: https://github.com/sp614x/optifine/issues/3844 https://github.com/sp614x/optifine/issues/3252

SHsuperCM commented 11 months ago

There is a cache length slider in the mod's config which raising should help with this. Though it will still come down to the size of the resourcepack used and the specs of your pc.

wahfl2 commented 11 months ago

Does it need to invalidate the entire CIT cache every n milliseconds? Surely there is a way to watch for NBT updates instead...

SHsuperCM commented 11 months ago

Does it need to invalidate the entire CIT cache every n milliseconds? Surely there is a way to watch for NBT updates instead...

Very intentional, there are changes planned that are not reliant on the nbt changing at all, the cache has to be invalidated in case these conditions are checked with different results. If you want to have it not invalidate until the nbt changes you can just max out the cache length(or set it to max value in the config json)

SrMonsterYT commented 10 months ago

Does it need to invalidate the entire CIT cache every n milliseconds? Surely there is a way to watch for NBT updates instead...

Very intentional, there are changes planned that are not reliant on the nbt changing at all, the cache has to be invalidated in case these conditions are checked with different results. If you want to have it not invalidate until the nbt changes you can just max out the cache length(or set it to max value in the config json)

I have the same problem with 1.20.1 https://youtu.be/5qc8y9BYTh8

wahfl2 commented 10 months ago

Turns out that the CIT parsing is incredibly slow in some cases, throwing and catching (and ignoring) thousands of errors per tick. I fixed this issue and improved performance slightly in PR #311, with screenshots included.