Smooth on a slow phone
Formo team · 17 May 2019
Hello,
We just spent three weeks making a chart move smoothly on phones that are older than our patience. Here is what it taught us about animation.
The stutter you cannot see in a screenshot
Smooth animation means a new picture every sixteen thousandths of a second — sixty a second. Miss one, and your eye catches it as a tiny hitch. Miss a few and it feels broken.
On a slow phone the usual enemy is not drawing; it is tidying up. Every time a program makes a new little object — a point, a colour, a rectangle — the browser has to throw the old ones away later. That throwing away is called garbage collection, and it happens whenever it likes, in the middle of your animation.
Our answer is to stop making garbage. We make objects once, at the start, and reuse them: like a restaurant that washes the same plates instead of buying new ones for every meal. Points and matrices — the little pieces that every move, rotate and scale is made of — are made once and reused again and again.
Same chart, same speed: the flat line is the version that does not make garbage.
Plain HTML, but alive
For the same contest we also wrote a small library that builds real web page elements and keeps them connected to values. Change a value and exactly the elements that show it update — no more, no less. Nothing rebuilds the whole page, so nothing flickers.
You feel this in our editor prototype: change a value anywhere and every panel showing it updates by itself, and dragging stays smooth even with a lot on screen.
If you animate, smoothness is not a luxury; it is the thing your audience feels first. Tell us how your own animations run on your device.
As always, let us know what you think on our Discord.