- Have updates that we’d like, if we can, but we can discard if we don’t have time
- Detail / accuracy. If we’re running out of time, do an update with cheaper calculations.
This is quite a cool idea, and actually pretty easy. You can see for example in the main famin loop (still not ready yet :)) that we do actually track frame time in each loop and if we’re running over time, pause the dequeue, draw a frame and resume after.
I actually got this idea from Famous 0.3.5, but amazingly it was absent in the rewrite. The technique works amazingly well! I used it also in famous-views and the difference was very noticeable.
Anyways, point being, just like we provide NodeComponent
update() functions with a DOMHighResTimestamp, we could also provide them with variables describing or relating to the current dequeue status, e.g. TIME_GREAT, TIME_OK, TIME_BAD, or something. That’s very easy to do and then the developer can use or ignore that info (by default, of course, everything runs).