Skip to content

Conversation

gaearon
Copy link

@gaearon gaearon commented Jun 16, 2021

This is an essential part that most comparisons and ports to other libraries tend to miss.

Of course, React is not the most efficient way to render a viz like this. You're better off with GL. But this particular example I'm adding has a neat aspect.

When the checkbox is ticked, each square is forced to spend 0.1ms blocking the thread. This simulates "death by a thousand cuts" where you have a large update that needs to run a bunch of user-written code. There's just no way you can "optimize it away". What's interesting is how the system handles a bunch of computational work distributed between a tree of components.

Compare the behavior with startTransition vs without it.

Demo link

Tick this checkbox:

Screenshot 2021-06-16 at 02 21 39

The effect is pronounced after you increase the tree size with the slider on the left.

@vercel
Copy link

vercel bot commented Jun 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/swizec/react-fractals/7HkcdkzhmX6twbAFVQKjAx3eA2F7
✅ Preview: https://react-fractals-git-fork-gaearon-block-swizec.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants