Re: [whatwg/dom] Proposal: ParentNode.replaceAll() / ParentNode.replaceChildren() (#478)

@FergoTheGreat Is there a reason you're not using Canvas?

An empty DOM element in Chrome requires around 1KB empty last I checked, and 120k of just those, without nested children, comes out to 0.1-0.2 GiB.

If you need to constantly replace nodes like that, try Canvas 2D instead. That gives you an immediate mode API where you can just blank the screen (`context.clearRect(0, 0, canvas.width, canvas.height)`) and re-draw everything any time you need to update. It's a very simple and intuitive API once you learn it, and it's one I'm surprised *hasn't* been ported to death in native-targeting languages like some Web APIs (like `URL`) have.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/478#issuecomment-2185635477
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/478/2185635477@github.com>

Received on Monday, 24 June 2024 05:25:56 UTC