Shattering 5 time crystals is very slow
It takes several hundred milliseconds, which means clicking the button multiple times quickly doesn't really work: it lags way behind the clicks.
This seems to be happening even without resource retrieval (which had been my first suspect for what's going on); profiling shows lots of innerHTML sets and style recomputation each time the year rolls over.
It seems like the UI is getting updated for each time crystal shattered; it might make sense to skip some of that work, maybe.
Comments (4)
-
-
reporter For what it's worth, I did try that and that made things a bit better; now shattering 5 time crystals takes around 100ms instead of 300-ish. Still not great, and I don't know whether any of the calculations under ui.render are in fact needed...
-
I believe ui.render is unnecessary because it's already in a global loop.
-
- changed status to resolved
- Log in to comment
@freeroot Are there any necessary calculations in the ui.render call? Can we just add an argument to onNewYear to skip the rendering until after the shatter loop?