Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Slightly improve performance of hydration. #15998
Avoid loading nodeType and data couple times from the same node in a row,
ReactDOM: size: 0.0%, gzip: -0.1%
Details of bundled changes.
Jun 27, 2019
13 checks passed
Thanks. I'm wondering if it's possible to do something about this in general. While it's probably possible to optimize this a bit more with the current approach, having to materialize all these wrapper objects is always gonna remain a bottleneck.
cc @developit @ timneutkens
One thing we could do is drop all validation but still preresolve references to the node. Is there a way to walk the DOM while not materializing JS wrappers or cheaper ones?
We used to have a lazy approach but that instead paid the cost when the user interacted with something and also added complexity and meta-data that made it overall not worth it.
We’re moving to a selective hydration approach driven by interaction which effectively makes the paths lazy but also able to warm up in preparation for an interaction. So the characteristics are about to change.