unsoluble / smalltime

A small FoundryVTT module for displaying and controlling the current time of day.
MIT License
24 stars 15 forks source link

[Performance] Hitching when SmallTime is loaded #106

Closed grankless closed 2 years ago

grankless commented 2 years ago

System: PF2e This issue began on 8.9, but has persisted through v9. Me and my players have significant frame hitching when SmallTime is active, even with no other modules active. The new FPS meter in Foundry does show our FPS is reduced from ~67 to ~58-59, which is fine, but the hitching does not seem to be reflected in the FPS meter at all. It just does it.

Unsure of what other info I can provide.

unsoluble commented 2 years ago

Can you describe this "hitching" effect in more detail? What parts of the UI or play experience seem affected?

Is this perhaps only when the real-time clock is running?

Do you have PF2's darkness sync enabled?

grankless commented 2 years ago

The "camera" so to speak seems to freeze - here's a gif I screen captured. https://i.imgur.com/apCil8Q.gif

It only happens when the game is unpaused, so the thing is running.

Synchronize Darkness is unselected.

grankless commented 2 years ago

We all have WebGL enabled ,I've verified. I will note that the performance issues are more severe on FIrefox than Chromium browsers.

unsoluble commented 2 years ago

Okay, thanks for the details.

Does it happen when the game is unpaused but the realtime clock is stopped? Or only when the clock is also running?

grankless commented 2 years ago

I didn't even think to do that - that DID stop it. Performance seems great with realtime clock stopped (through simplecalendar, not sure about how to do it with worldclock).

So it seems to only be with the clock running. I have verified with a player that it seems to have solved it on their end too. They seem to still be having a couple microstutters, but nothing that's at all a downside. Thank you for solving the issue for me as a stopgap - I have no idea if this will be like, a "fixable" issue, but at least I'm a satisfied customer. Thank you.

unsoluble commented 2 years ago

Hey thanks for poking at it for me -- really helps to narrow things down like that.

I think probably it's just a matter of the constant clock updates rendering more frequently than they need to. Will investigate when I've got a chance here.

grankless commented 2 years ago

Thank you.

unsoluble commented 2 years ago

@grankless Sorry for the rather long delay, haven't had the time to poke at this more until now. If you're still around, could you let me know whether the lag still happens (with the realtime clock running) when the only modules you've got enabled are SmallTime and Simple Calendar?

I can't replicate any slowdowns with just those two running, but the constant time changes do trigger a number of other hooks every second, which may be cascading into other modules' behaviour. Would like to narrow this down.

grankless commented 2 years ago

Oh hey, just saw this. I went in and did Find The Culprit again - I did find that having real time clock stuff on with Simple Calendar did reduce my FPS down to about 30...

Did Find the Culprit...

And then it was just fixed? I have no idea what happened. Maybe a setting got refreshed or something? But I finally have it resolved in at least one world, which is the one it was most markedly severe in. I'll try in other worlds as soon as I can.

unsoluble commented 2 years ago

Weird! Lemme know if it crops up again, we can continue to try to triangulate the cause.