3 ms·
I was thinking more that if you repeatedly access a property, regardless of where in the prototype chain it is, the optimiser would cache the value, so it would
by gillespie 14y ago
I was thinking more that if you repeatedly access a property, regardless of where in the prototype chain it is, the optimiser would cache the value, so it would be equivalent to saving it in a local variable. If I'm not mistaken, this is a common feature in optimizing compilers. I don't know how aggressive the JIT js compilers are, however.
- firefoxman1 14y agoHmm that's pretty interesting. I don't really like to depend on the engine for optimizations because you never know what JS engine people have, but it's good to know they do that.