News for hackers. Stuff that matters.
Re:We should be more ambitious with the software we build by Rohansi on Sunday October 25, 2026 @07:37PM (#50237137)
SVG animation in a browser works completely differently than a game engine handles animation. SVG is based on the DOM and animating it requires mutating the DOM. Lots of string operations because everything is a string attribute. All of that has a ton of unnecessary overhead.

You actually would have been better off replacing your SVG animation with a game loop! Assuming you're using Lottie you can easily swap it to render into a `<canvas>` which doesn't have any of that overhead and uses `requestAnimationFrame` which automatically gets throttled in inactive tabs.

There are no comments on this comment yet.