Loading video...

Video Failed to Load

Go Home

React smoothly redrawing ~20,000 dom nodes. but yeah I'm sure it's too slow for your crud ui

105,785 views • 1 year ago •via X (Twitter)

10 Comments

Swizec Teller's profile picture
Swizec Teller1 year ago

Mate, this is too many dom nodes for chrome devtools to work (takes 10s to open inspector). Of course it noms memory

MJ's profile picture
MJ1 year ago

This is why I’m skeptical of rendering libraries that run micro benchmarks showing how they are like, soooo much faster than React. React is already fast enough.

Fox 🇵🇸's profile picture
Fox 🇵🇸1 year ago

I mean the problem with React is it is too easy to shoot yourself in the foot and cause rerenders. It is one of the reasons I am more bullish on signal based systems like Solidjs

Dillon's profile picture
Dillon1 year ago

But imagine how much quicker it would be if you wrote it in Rust and complied to WebAssembly and… never shipped it?

Swizec Teller's profile picture
Swizec Teller1 year ago

There are no memos in here btw But I do use React Query to load data with stable object identities

Truong Hoang Dung's profile picture
Truong Hoang Dung1 year ago

In tradeoff of huge memory.

Munawwar Firoz's profile picture
Munawwar Firoz1 year ago

Oddly I've seen it to be slow on large forms that rerender on every keystroke (at least this was react 16). 2-4ms for render function to complete, 100ms for react to diff and patch. The fix that made a difference was to memoize the vdom and bust cache on fields that need change.

pedreiro de software's profile picture
pedreiro de software1 year ago

DOM nodes never were the issue. The JS re-render part is. Try putting 1.000 controlled material ui checkboxes without memo or anything and see it crumble

Raketenziesel's profile picture
Raketenziesel1 year ago

Not talking about premature optimization here, but this should be canvas. Why 20,000 nodes for a display that could only reasonably display (4k) about 1000 of them horizontally, this is a usability problem too. What happens if you compare 10 of them below each other?

Ken aka Frosty's profile picture
Ken aka Frosty1 year ago

probably worth noting this here too

Related Videos