-
-
Notifications
You must be signed in to change notification settings - Fork 36k
TSL: Replace Proxy
approach with prototypes
#31691
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Why does switching from Proxy to standard objects improve performance? Are proxy gets/sets slower than regular object get/sets? |
We are already using a |
Getters and setters were too slow in 2013 so I ended up having to do this: 972c852 |
I’m ignoring the property shortcuts |
Proxy
approachProxy
approach with prototypes
Related issue: #30849
Description
The new approach should improve performance overall, both in compilation and updates, as well as make debugging easier.
The most affected part is array access through numeric constants, which was limited between 0–32. Luckily, it’s uncommon to use constants for values larger than that. In all cases, it’s better to use
a.element(b)
, which accepts dynamic values.