High performance Javascript reading notes 2 – Data Access

• Literal values and local variables can be accessed very quickly, whereas array items and object members take longer.

• Local variables are faster to access than out-of-scope variables because they exist in the first variable object of the scope chain. The further into the scope chain a variable is, the longer it takes to access. Global variables are always the slowest to access because they are always last in the scope chain.

• Avoid the with statement because it augments the execution context scope chain. Also, be careful with the catch clause of a try-catch statement because it has the same effect.

• Nested object members incur significant performance impact and should be minimized.

• The deeper into the prototype chain that a property or method exists, the slower it is to access.

• Generally speaking, you can improve the performance of JavaScript code by storing frequently used object members, array items, and out-of-scope variables in local variables. You can then access the local variables faster than the originals.

个人分类: Performance Rules
想对作者说点什么? 我来说一句

High Performance JavaScript

2010年04月28日 4.43MB 下载

ASP.NET Core 2 High Performance(2nd) azw3

2018年03月16日 5.53MB 下载

High Performance Spark pdf 完整版 免费

2017年11月11日 6.59MB 下载

C++ High Performance

2018年02月02日 4.96MB 下载


2017年09月10日 33.37MB 下载

Python High Performance(2nd) 无水印pdf

2017年10月04日 3.21MB 下载