- for (...) {}
- array copy: new Array(len) and copy in loop is fastest
- concat vs unshift
- Visitor(eval seems no performence degradation)
- Cache: no difference, but cached faster in IE 11 (except array item cache)
- Enumerate Object Properties
- apply arguments
- create object: (new Object() vs {})
- create array: (new Array() vs [])
- init object: (new Object() vs {})
- get value from object: (new Object() vs {}): not stable, seems almost no difference.
- flag operation: no difference, but !! and ! faster in IE 11
- check reference nil vs check another flag: check flag is faster
- check property exists
- Object literal vs custom constructor: in some browser literal returns by function is fastest
- Get Set
jsperf 扩展:https://gist.github.com/jareguo/99cf83d1d851b53e37963316afadbcc7
Benchmark playground
- Let’s get those Javascript Arrays to work fast
- Google Closure: How not to write JavaScript
- node.js背后的引擎V8及优化技术
- Breaking the JavaScript Speed Limit with V8 (Youtube) | PPT
- Optimization killers
- Writing Fast, Memory-Efficient JavaScript EN | ZH
- ES6性能测试
- JS Tips