Shattering 5 time crystals is very slow

Issue #103 resolved
Boris Zbarsky created an issue

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)

  1. coderpatsy

    @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?

  2. Boris Zbarsky 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...

  3. Log in to comment