Stop Blaming Re-renders. You're Optimizing the Wrong Thing.
This post is part of a series. Start here if you haven't already. After the benchmarks post , I got a question that comes up every time I talk about Inglorious Web's rendering model: "If the whole tree re-renders on every state change, wouldn't it be better if you memoized render functions the way React does with React.memo ?" It's a reasonable question. It's also solving the wrong problem. What memoization actually costs Memoization isn't free. A cache lookup happens on every call — whether or not the cached value is stale. In a busy UI, that's constant overhead, paid regardless of whether the memo ever saves you anything. And it saves you less than you'd think, because lit-html already does its own caching at the template level. It tracks which parts of a template changed between renders and only patches those DOM nodes. Adding a JS-side memo layer on top means you're diffing twice: once in your cache, then again in lit-html. The second diff doesn't know what the first already handled. So memoizing render functions in Inglorious Web would mean: always paying a cache lookup cost, sometimes saving a function call, while lit-html does its own DOM diffing regardless. The math doesn't work out. What signals actually cost The usual counter-proposal is: "fine, skip memoization, but use signals instead. Only update the parts of the tree that depend on what changed." Signals are magic. Not in the fun sense — in the sense described in the first post of this series . Each reactive primitive maintains its own list of subscribers, built and updated at runtime, invisible to you as you write code. When a signal changes, it pushes to that list. Fine-grained reactivity works by having many small signals, each with its own observer registry, each encoding a piece of a dependency graph you didn't write and can't read. That's memory. Multiple signals means multiple registries. And those registries encode a dependency graph that's implicit, assembled at runtime, and opaque by design.