Closed jfschwarz closed 2 years ago
Turned out that the bottleneck is the GPU when updating the SVG gradients. So we have to conclude that we cannot significantly improve the situation 😞
Still going to push a new PR with some of the improvements from this branch.
Turns out handlebars and the SVG update is already blazing fast, but we can significantly reduce the update cost by memoizing some parameter computations (in particular the astronomy math for calculating planet positions was expensive and ran on every render).
In addition to that I moved the throttling logic to the picker component and use
requestIdleCallback
and React 18's newuseTransition
to de-prioritize the global state update as much as possible. It still needs some extra throttling, but imo the current state feels acceptable. Wdyt?