Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
Chrome 60
Windows
Other
7 years ago
Test name Executions per second
1 div with javascript 1499131.0 Ops/sec
1 div with jquery selector 1574448.6 Ops/sec
2 divs with javascript. Add with jquery 328708.9 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 327396.9 Ops/sec
2 divs with javascript. Add with array 888200.8 Ops/sec
2 divs with 2 jquery selectors. Add with array 469939.6 Ops/sec
2 divs with single jquery selector 479.3 Ops/sec
1 div with jquery selector with context 735375.4 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


;