Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
Chrome 59
Windows
Other
7 years ago
Test name Executions per second
1 div with javascript 813507.2 Ops/sec
1 div with jquery selector 919865.0 Ops/sec
2 divs with javascript. Add with jquery 202903.7 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 216604.0 Ops/sec
2 divs with javascript. Add with array 485585.6 Ops/sec
2 divs with 2 jquery selectors. Add with array 331587.4 Ops/sec
2 divs with single jquery selector 232.6 Ops/sec
1 div with jquery selector with context 443490.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