4 ms·
Proxies aren’t actually that slow, the problem is the committee refusal to acknowledge indexed properties as being something that actually exists. The result i
by olliej 8y ago
Proxies aren’t actually that slow, the problem is the committee refusal to acknowledge indexed properties as being something that actually exists.
The result is that all property names passed to the interceptor get converting to a string.
That means if for example you were intending to proxy an array, your performance is destroyed.
First a numeric index gets converted to a string, then when to pass that on to your target array it has to be parsed back into a number.
In a trivial case (literally just forwarding the access) it might be possible to fake the stringing of the property name, but if you actually end up doing real work it becomes increasingly hard to avoid the property name escaping and so having to be reified.