One clip-path doubled my browser cat's CPU cost in Chrome's GPU process
I made Tabloaf , a pixel cat for Chrome and Firefox. It walks across whatever page you have open, sits on pictures and headings, and chases a ball of yarn. TL;DR: while the cat walks, Chrome's GPU process went from 15–17% of a core to ~7%, and Firefox's page process from 19–20% to ~2%. Chrome renders the page in a renderer process and composites layers in a separate GPU process. In Firefox the…
A pixel cat named Tabloaf was created for Chrome and Firefox browsers. While walking across web pages, Tabloaf caused a noticeable increase in CPU usage when using Chrome's GPU process. Specifically, Chrome's GPU process went from 15-17% of a core to approximately 7%, and Firefox's page process went from 19-20% to around 2%. The main cause of the increased CPU usage in Chrome was the use of the clip-path feature on the cat's canvas, which caused the GPU process to work harder in rendering the page.
By moving the cat using Web Animations and separating the cat's outline into a different element, the CPU usage in both Chrome and Firefox was significantly reduced. In Chrome, the GPU process dropped from 15-17% to around 8%, while in Firefox, the page process went from 19-20% to approximately 2%. The optimized version of Tabloaf maintained a consistent 17.5 ms frame time in Chrome traces, with no frame exceeding 20 ms.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.