TSL: Replace Proxy approach with prototypes#31691
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.