Optimization useState
and useReducer
returned tuple
#54
SukkaW
started this conversation in
Feature Requests
Replies: 1 comment
-
Prior art: ReScript compiler, mentioned in this tweet by @r17x https://fxtwitter.com/__r17x/status/1881973624913170697 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
v8 (and many other javascript runtimes) never optimizes the array destructure access as fast as array index access. So code block A is always faster than code block B:
Check this benchmark.
The main idea is, we should still do array destructuring (B), while React Compiler could optimize into array index access (A) to gain performance.
Beta Was this translation helpful? Give feedback.
All reactions