Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox 60
Windows
Other
6 years ago
Test name Executions per second
1 div with javascript 1818191.1 Ops/sec
1 div with jquery selector 2064467.1 Ops/sec
2 divs with javascript. Add with jquery 507530.6 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 544267.6 Ops/sec
2 divs with javascript. Add with array 871396.4 Ops/sec
2 divs with 2 jquery selectors. Add with array 770025.4 Ops/sec
2 divs with single jquery selector 397.1 Ops/sec
1 div with jquery selector with context 487338.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