Run details:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Chrome 52
Windows 7
Other
8 years ago
Test name Executions per second
1 div with javascript 898872.8 Ops/sec
1 div with jquery selector 829163.4 Ops/sec
2 divs with javascript. Add with jquery 133214.9 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 116193.8 Ops/sec
2 divs with javascript. Add with array 297819.9 Ops/sec
2 divs with 2 jquery selectors. Add with array 188295.0 Ops/sec
2 divs with single jquery selector 207.9 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • 1 div with javascript

  • 1 div with jquery selector

  • 2 divs with javascript. Add with jquery

  • 2 divs with 2 jquery selectors. Add with jquery

  • 2 divs with javascript. Add with array

  • 2 divs with 2 jquery selectors. Add with array

  • 2 divs with single jquery selector

  • 1 div with jquery selector with context