My Authors
Read all threads
Several people have asked me to make a @sveltejs version of this interesting demo that's doing the rounds, which purports to show how fast React can be with 'scheduling'. Let's take a look!
@sveltejs (bear with me here, Twitter isn't letting me upload these videos...)
@sveltejs On the left, we have the React version, running in prod mode. On the right, Svelte (in dev mode, because I forgot to build it. Oh well.) Notice the huge gap in the React version whenever you change the count. With Svelte? Honey badger don't care.
@sveltejs In fact, you can change the dropdown to a slider and you still have a functioning app with Svelte, whereas React fails hard.
@sveltejs What's interesting about this is that I haven't had to muck about with Svelte internals at all. Whereas react-three-fiber has to implement its own reconciler. But that's only half the story.
The real secret sauce in the React demo is Zustand, which speeds up your React app by... bypassing React. Instead of passing props to components, you update them by imperatively manipulating refs — the inverse of the React programming model!
So it's probably incorrect to say that it shows how fast React can be — rather, it's showing you how to build a fast app *despite* React. Meanwhile, you often see this sort of thing in React perf demos, presumably because React can't be trusted to update the FPS counter?
None of this is a knock on react-three-fiber, which is magnificent. @0xca0a is a force of nature and you should all be following him. Just remember that 'scheduling' doesn't let you break the laws of physics. The best way to get better performance: do less work.
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Rich Harris

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!