unsoluble / smalltime

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

[PERFORMANCE] Controling the scene darkness with smalltime can be quite slow #102

Closed mech-tools closed 2 years ago

mech-tools commented 2 years ago

Hello,

FVTT 0.8.9 Smalltime 1.13.7 Simple Calendar 1.3.75 5e 1.5.5

When the scene's darkness is controlled by smalltime and the GM fiddle with the moon/sun icon from left to right, and after switching scenes, etc. As some point, darkness transitions begin to be quite slow, to the point where darkness is not sync with smalltime (eg. full darkness when smalltime indicates day light)

Maybe this can be improved? Like having some sort of debounce on the sun/moon icon drag/drop, so foundry does less darkness transition?

unsoluble commented 2 years ago

Does this happen with no other modules enabled? I've never seen that kind of behaviour.

mech-tools commented 2 years ago

@unsoluble yes.

Only with smalltime.

Basically:

EDIT: when I write "play with the sun/moon icon", I mean drag from left to right and right to left extensively, altough I don't need that, it's the fastest way to reproduce.

unsoluble commented 2 years ago

Strange. I can't replicate that at all here. Can you provide some more contextual details? OS, browser?

mech-tools commented 2 years ago

@unsoluble yes. Windows 10 Chrome 96.0.4664.110

The map I use for tests is: 2279x1629 (with in an image of the same size) There are map notes as well on it.

unsoluble commented 2 years ago

Yeah sorry, I can't reproduce this no matter what I try. Sliding around the sun/moon control is always fully responsive in reatlime.

mech-tools commented 2 years ago

@unsoluble ok, maybe it's unique to my setup. I forgot to mention, that I run a server and not the electron app.

346184 commented 2 years ago

I'm running into this too. Hosted on Forge. Found no way to reliable reproduce yet, only seems to happen to me after quite some time spent playing.

unsoluble commented 2 years ago

All I can do is wait for reproduction steps that work on my end I'm afraid.

mech-tools commented 2 years ago

@unsoluble random thoughts:

Drag event (setupDragHandles) is bind in the renderSettingsConfig hook. Are we sure this hooks is called only once? Should we use the once keyword instead of on? Or binding the drag event outside of this hook?

unsoluble commented 2 years ago

That's just the setup for the sunrise/sunset controls, happens on module settings screen render. Not sure how this would impact anything else.

mech-tools commented 2 years ago

@unsoluble Ah, read the code too fast. Well :/

remiverdel commented 2 years ago

I see the same problem but usually only when I have players connected. I’m hosting on AWS. What happens is, I move the cursor to night time and nothing happens for a few seconds then darkness changes erratically (switches instantly between day and night and everything tends to lag) for sometimes up until 20-30 seconds until it settles. It’s maybe trying to sync between clients and gets confused because of delays?

346184 commented 2 years ago

All I can do is wait for reproduction steps that work on my end I'm afraid.

Yeah thats reasonable of course :) If I can get it to reproduce, I'll let you know. Also just wanted to say - its not a deal breaker issue for me, it occurs rarely enough and isn't enough of a hassle, so I'm still enjoying using the module.

Thanks for all your work to make Foundry even more awesome, have a great 2022!

Avitale34 commented 2 years ago

I have noticed the performance degrades when the Clock is Live and running. When the game clock is not running performance is fine.

unsoluble commented 2 years ago

@Avitale34 What game system? I'm gonna poke at this later tonight.

Avitale34 commented 2 years ago

@unsoluble I am using DND 5e on the Forge.

unsoluble commented 2 years ago

Going to need someone to confirm that they're getting framerate drops with only SmallTime and SimpleCalendar involved — I can't reproduce any performance issues in that scenario no matter what I try.

remiverdel commented 2 years ago

On my end it seems to only when there is other people connected. When I’m alone on the server it’s smooth but with other players it wiggles back and forth between day and night, gets laggy before finally settling down

Rémi Verdel

Le 13 avr. 2022 à 18:15, John Weston @.***> a écrit :

 Going to need someone to confirm that they're getting framerate drops with only SmallTime and SimpleCalendar involved — I can't reproduce any performance issues in that scenario no matter what I try.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

unsoluble commented 2 years ago

Sorry, my fault for not properly redirecting the conversation — we've got two different issues here. For the realtime clock stuff, we'll continue in #106.

@remiverdel I've seen that behaviour before for sure, but also have a hard time reproducing it. I'll poke a bit more, but I might end up needing to just remove the realtime darkness changes as you're dragging the slider and just do one update at the end.

mech-tools commented 2 years ago

@unsoluble I'm good with that, maybe some kind of debounce at first?

unsoluble commented 2 years ago

Yep, I'll see how a debounced slider feels first, might be all it needs.

unsoluble commented 2 years ago

Should be much improved in 1.13.15; lemme know if any of you are still experiencing janky behaviour here.