Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 18 beta #1002

Closed
LifeIsStrange opened this issue Feb 11, 2022 · 7 comments
Closed

React 18 beta #1002

LifeIsStrange opened this issue Feb 11, 2022 · 7 comments

Comments

@LifeIsStrange
Copy link

It would be nice to add a react 18 beta entry.
I know it's not officially stable yet but I'm very curious about the "automatic batching" improvement and it's been a year since react 17

@oleggrishechkin
Copy link
Contributor

Hi, @LifeIsStrange.
In my local tests react18 with concurrent mode (createRoot) slightly slower than react17. Especially in "clear rows".
I think that "automatic batching" doesn't improve performance at all in this benchmark, even react17 batch all updates as well as react18 in most cases.

@LifeIsStrange
Copy link
Author

LifeIsStrange commented Mar 19, 2022

for posterity I was refering to those improvements:
reactwg/react-18#21
Thanks for reporting :) Well it's unfortunate to hear react doesn't improve on this benchmark, could it be that react 18 would be faster than 17, when concurrent mode is disabled?
there is also a third mode:
ReactDOM.createBlockingRoot(rootNode).render()
cf https://reactjs.org/docs/concurrent-mode-adoption.html#feature-comparison

@oleggrishechkin
Copy link
Contributor

oleggrishechkin commented Mar 19, 2022

The main problem with react is a diff algorithm. Swap rows has terrible performance and move react to the end of results list. With true state management we can improve selecting a row and partial update performance - all other tests should be the same for all state managers (but they can add some overhead).

In my tests I update only rows that needed directly (forceUpdate with useReducer) and it's the fastest solution for react, but useless (bad dx).

But I really waiting for react18 release!

@krausest
Copy link
Owner

Here's a look at react's performance for rc3 of version 18:
Screenshot from 2022-03-22 20-19-03
I didn't commit the code,iIt's just the react-hooks implementation with react and react-dom@rc.

@Sparkenstein
Copy link

v18 is stable now :D
any plan to merge this? I would recommend keeping both v17 and 18 since v18 is entirely different algorithm and it also gives features like Server rendered components etc.

@ryansolid
Copy link
Contributor

I believe all merging has been halted while trying to figure out what in the world is happening here: #1020. I think might have landed on the new test setup now.

@krausest
Copy link
Owner

Right - I first had to solve that nasty #1020
React 18 has been merged.

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

No branches or pull requests

5 participants