Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko
IE 11
Windows
Other
8 years ago
Test name Executions per second
1 div with javascript 1296386.2 Ops/sec
1 div with jquery selector 1224216.6 Ops/sec
2 divs with javascript. Add with jquery 275512.9 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 270175.8 Ops/sec
2 divs with javascript. Add with array 528134.1 Ops/sec
2 divs with 2 jquery selectors. Add with array 375589.5 Ops/sec
2 divs with single jquery selector 362.5 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