Browser cat extension's CPU cost cut by moving walk animation to Web Animations API

The developer of Tabloaf, a pixel cat that walks across Chrome and Firefox pages, found that a clip-path on its moving canvas roughly doubled Chrome's GPU process CPU use while the cat walked. Earlier, the cat's walk ran on requestAnimationFrame, and switching straight walks and runs to Element.animate() reduced load further. To keep clicks accurate, the developer split the cat into a non-interactive canvas and a separate hit element shaped by a clip-path, both moving on the same animation clock. In Chrome, this brought the GPU process down from about 14% to about 6% of a core during a walk, while in Firefox the page process fell to roughly 2%. The post also explains that the hit outline was simplified during walks, trading some precision for lower overhead.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in