Skip to content

Latest commit

 

History

History
8 lines (4 loc) · 850 Bytes

performance.md

File metadata and controls

8 lines (4 loc) · 850 Bytes

Performance Issues

  • The lookup time for properties that are high up on the prototype chain can have a negative impact on performance, and this may be significant in code where performance is critical. Additionally, trying to access non-existent properties will always traverse the full prototype chain.

  • Also, when iterating over the properties of an object every property that is on the prototype chain will be enumerated.

  • It is essential to understand the prototypal inheritance model before writing complex code that makes use of it. Also, be aware of the length of the prototype chains in your code and break them up if necessary to avoid possible performance problems. Further, the native prototypes should never be extended unless it is for the sake of compatibility with newer JavaScript features.