mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
1d800dfda16468f2cd2d80460e2d3d3f36a3e902
Object literals should be faster at least on React Native with Hermes as the JS engine. It might also be interesting to confirm the old comments in this file from years ago are even still valid. Creating an object from a literal should be a simpler operation. It's a bit unfortunate that this introduces a bunch of copied code, but since we rearely update the fields on fibers, this seems like an okay tradeoff for a hot code path. An alternative would be some sort of macro system, but that doesn't seem worth the extra complexity. DiffTrain build for commit https://github.com/facebook/react/commit/fe9828954adcc51aa2bd21fe53d969a44dd3c9d2.
react-fbsource-import
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%