Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586
Chrome 46
Windows
Other
8 years ago
Test name Executions per second
1 div with javascript 1097431.0 Ops/sec
1 div with jquery selector 1037382.0 Ops/sec
2 divs with javascript. Add with jquery 172028.0 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 161307.5 Ops/sec
2 divs with javascript. Add with array 597888.6 Ops/sec
2 divs with 2 jquery selectors. Add with array 283824.6 Ops/sec
2 divs with single jquery selector 335.8 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