PieKing1215 / InvMove

Minecraft Forge/Fabric/Quilt mod that adds the ability to walk around while in inventories
GNU Lesser General Public License v3.0
23 stars 7 forks source link

Performance issue due to repeated file access #28

Closed Luke100000 closed 1 year ago

Luke100000 commented 1 year ago

While in inventory, rapid Files.exists() calls drops FPS to 3.

InvMove.onInputUpdate() calls allowMovementInScreen() calls InvMoveForgeClient$1.modidFromClass(), and from there it seems like an uncached resource/class lookup. Maybe wrap modidFromClass into a cache?

I marked the affected method: https://spark.lucko.me/xIkj5lSwQ7?hl=65

PieKing1215 commented 1 year ago

Interesting, I've never seen that be a performance bottleneck but I'm not sure why I didn't have a cache anyway. When https://github.com/PieKing1215/InvMove/actions/runs/4419216864 is done can you see if that fixes it?

Luke100000 commented 1 year ago

That was quick! Yes, no more FPS drops on a quick test run. Thanks!