Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.101 Safari/537.36
Chrome 53
Mac OS X 10.11.6
Other
8 years ago
Test name Executions per second
1 div with javascript 1450404.5 Ops/sec
1 div with jquery selector 1272337.5 Ops/sec
2 divs with javascript. Add with jquery 310338.4 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 275611.3 Ops/sec
2 divs with javascript. Add with array 795640.7 Ops/sec
2 divs with 2 jquery selectors. Add with array 421307.9 Ops/sec
2 divs with single jquery selector 277.6 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