How does the performance of React 16 compare to Preact? I understand that Preact is still a smaller filesize, but fibers (and async when it’s enabled) sounds like it’ll be faster than Preact.
We are using Preact for a small mobile site, so I’m wondering if it’s worth switching.
IIRC, preact is faster by the virtue of being smaller so it's loads faster, but React is actually more efficient when updating the state, in some ways.
The "Fiber" stuff is FUD until we see some perf comparisons. It irks me that React gave their rewrite a codename and talked about perf, and so many people are now have this "Fiber is fast" stuff in their head without any real evidence. I've seen evidence that Preact is fast.
The React team did say, many times, that React 16 was not intended to be a "make everything faster" release. The "React Fiber" internals rewrite was intended to enable making re-rendering asynchronous in the future, but for now, the overall rendering process is still done synchronously to maintain compatibility with 15 behavior-wise. It's possible that the changes may make things smoother for your app now, but this was not a pure-perf-oriented set of changes. (The future asynchronous rendering is also not strictly speed-related either, but rather opens up a lot of possibilities for how React prioritizes updates.)
The initial improvement that Fiber gives is about splitting up the rendering process into bite-size chunks so that the determination of what does need to change doesn't block the main thread. The rewrite of the internals also made the codebase more maintainable, and gave them a chance to implement often-requested features like returning strings or arrays from render(), as well as implementing error boundaries.
You know very well that community doesn't hear nuance, all they hear is that Fiber=fast and this is why people question the Preact developers with stuff like "will you implement Fiber". I know that FUD wasn't the goal, but FUD is the result of overhyping a rewrite and giving it a codename.
It's all perceived performances, not real, raw performances.
Synchronous react rendering will still be as slow as ever.
This rewrite is a bit pointless to me, increase the complexity of using React on the long term (before, you could count on synchronous rendering having predictive results) and is just a hack to spread the cost of react's rendering across multiple frames. If anything your site will take longer to render now that it's async :)
I'm wary of progressively rendered sites (like Facebook) where buttons are rendered but don't work for the first few hundred milliseconds or seconds anyway. Complex websites can already defer the rendering of their most expensive parts (e.g google maps, etc); baking it in the framework sounds like engineers who had too much free time to me :p
We are using Preact for a small mobile site, so I’m wondering if it’s worth switching.