Like Google Sheets where multiple people edit at once - but SUPER fast! Watch how only the cells that change get updated.
Imagine a shared spreadsheet (like Google Sheets) where 3 people are editing at the same time. Each cell in the grid is independent - when Alice edits cell A1, only A1 updates. Bob and Charlie's cells stay frozen!
🔍 Look at the "R:" number in the top-left of each cell. That's how many times that cell re-rendered.
👉 Try this: Click "▶️ Start Simulation" and watch - only the cells being edited increase their "R:" count!
In real apps (like spreadsheets, collaborative docs, or dashboards), you might have hundreds or thousands of cells. If every cell re-renders when ONE changes, your app becomes laggy and slow! 😰
✏️ User types in 1 cell
⚠️ ALL 25 cells re-render!
It's like repainting your entire house just to fix one scratch! 🏠
With 100 cells: That's 100 updates for every keystroke! 💀
✏️ User types in 1 cell
🎯 Only THAT cell re-renders!
Like fixing just the scratch - leave everything else alone! ✨
With 1000 cells: Still just 1 update! Blazing fast! 🚀
// Create 25 independent signals (5x5 grid)
const cellSignals = Array.from({ length: 5 }, (_, row) =>
Array.from({ length: 5 }, (_, col) =>
createSignal({ value: '' }) // Each cell is separate!
)
);Think: 25 separate light switches, not 1 master switch! 💡
function Cell({ row, col }) {
const cell = useSignalValue(cellSignals[row][col]);
// This cell ONLY updates when cellSignals[row][col] changes!
return <div>{cell.value}</div>;
}Each cell minds its own business! 🎯
// When user edits cell [2,3]:
cellSignals[2][3].set({ value: '42' });
// ✅ Only cell [2,3] re-renders
// ✅ Other 24 cells? Frozen, no re-render!Surgical precision! Change only what's needed! ✂️
📊 Total Edits So Far: 0
👀 Watch the "R:" number in the top-left corner of each cell below. It shows how many times that cell re-rendered. Only edited cells will increase!
👥 Simulated Users (Watch for their colors when editing!):
Each cell is independent. Watch the "R:" counter to see which cells actually re-render!
// 5x5 grid = 25 independent signals
const cellSignals = Array.from({ length: 5 }, (_, row) =>
Array.from({ length: 5 }, (_, col) =>
createSignal({ id: `${row}-${col}`, value: '' })
)
);
// Each cell component subscribes to ONE signal
function ReactiveCell({ row, col }) {
const cell = useSignalValue(cellSignals[row][col]);
// Only re-renders when THIS cell's signal changes!
return <div>{cell.value}</div>;
}When user edits cell [2,3]:
cellSignals[2][3]ReactiveCell(row=2, col=3) re-renders// All cells in ONE big state object
const [cells, setCells] = useState(/* 25 cells */);
function ReactiveCell({ row, col }) {
// Subscribes to ENTIRE cells array
const cells = useContext(CellsContext);
const cell = cells[row][col];
// Re-renders whenever ANY cell changes! 😱
return <div>{cell.value}</div>;
}
// Edit one cell → ALL 25 cells re-render
setCells(prev => /* update cells[2][3] */);100+ metrics updating independently. Only changed widgets re-render.
1000+ messages. Only new messages render. Scroll stays smooth.
Each game entity is a signal. 60 FPS even with 1000+ objects.
Fewer re-renders in this demo
With 100-cell grids
With 1000-cell grids
Scale without slowdown