Up-Mods / OkZoomer

Adds a highly-configurable zoom key. The zoom is yours!
133 stars 25 forks source link

Unnormal amount of frame drop #47

Closed WhatsCosmicCrackin closed 2 years ago

WhatsCosmicCrackin commented 2 years ago

With "ok zoomer" installed I'm getting an average of 65 fps. without I get 76 fps. the test was performed over 2 min of looking at heavy terrain standing still with a command to look at the same block every time, with no other plugins installed only "fabric-api-0.44.0+1.18" and "ok zoomer-5.0.0-beta.3+1.17.1". I know it's only a 11 fps difference but it's significant, especially because the mod isn't even in use

2021-12-17_05 46 46

EnnuiL commented 2 years ago

I've noticed that the "Without Ok Zoomer" comparison omits the Fabric API; Could you try comparing Fabric with Fabric API and Fabric with Fabric API and Ok Zoomer? Because if my suspicions are correct, it isn't an Ok Zoomer issue, but a Fabric API one, and if it's indeed FAPI, I'd be pretty concerned about it

EnnuiL commented 2 years ago

Issue #57 confirmed that this isn't a FAPI issue, I'll investigate this issue

EnnuiL commented 2 years ago

Hmm, I did some comparisons between Ok Zoomer and no Ok Zoomer; On an instance containing only Fabric API and LazyDFU, I managed to reproduce this slight hit My main suspect is LibZoomer and its set iterations that is causing those slight slowdowns; Thankfully, on an already-intensive scenarios and with optimization mods (such as an another MC instance but with Canvas), the maximum that it has done is to make the stable FPS be slightly wobbly but otherwise, the FPS rate remained the same

Despite that, a mod that is feature-packed should not mean it should affect the FPS at all, and so, I'm working towards making those set iterations not affect performance at all. I already managed to get some extra FPS from switching to FastUtils! But yeah, I don't intend to stop there

Here are the screenshots so far:

Comparison Screenshots Ok Zoomer: ![2022-03-13_17 11 35](https://user-images.githubusercontent.com/85590273/158077647-82e553fe-960d-4585-9d5c-413d5efa0813.png) No Ok Zoomer: ![2022-03-13_17 14 06](https://user-images.githubusercontent.com/85590273/158077659-d2ca0806-42b5-4832-83ec-130a51b69f3a.png) Ok Zoomer with usage of FastUtils on LibZoomer: ![2022-03-13_17 16 57](https://user-images.githubusercontent.com/85590273/158077801-4785795a-a417-4288-b3bf-b34887edda21.png)
EnnuiL commented 2 years ago

And with a change that reduces those iterations when they're not necessary, I managed to reduce the tiny lag introduced by LibZoomer back to 0! Therefore, the next Ok Zoomer update will finally fix this issue

Comparison ![image](https://user-images.githubusercontent.com/85590273/160198348-43af2a58-176e-4153-9bc1-7ef90cdac583.png)
EnnuiL commented 2 years ago

Fixed on LibZoomer 0.4.1, which is now used by Ok Zoomer 5.0.0-beta.6