mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
f70848628dee74a46c3984a183c552b215346229
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 [fe9828954a](https://github.com/facebook/react/commit/fe9828954adcc51aa2bd21fe53d969a44dd3c9d2)
Please do not delete this branch
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%