Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36
Chrome 64
Mac OS X 10.13.2
Other
2025 years ago
Test name Executions per second
1 div with javascript 1575343.6 Ops/sec
1 div with jquery selector 1888430.5 Ops/sec
2 divs with javascript. Add with jquery 405317.3 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 419870.6 Ops/sec
2 divs with javascript. Add with array 903640.8 Ops/sec
2 divs with 2 jquery selectors. Add with array 562743.9 Ops/sec
2 divs with single jquery selector 456.1 Ops/sec
1 div with jquery selector with context 750452.1 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