Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Chrome 66
Windows
Other
6 years ago
Test name Executions per second
1 div with javascript 1353813.1 Ops/sec
1 div with jquery selector 1496537.9 Ops/sec
2 divs with javascript. Add with jquery 332281.5 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 332012.8 Ops/sec
2 divs with javascript. Add with array 776613.2 Ops/sec
2 divs with 2 jquery selectors. Add with array 481006.3 Ops/sec
2 divs with single jquery selector 415.1 Ops/sec
1 div with jquery selector with context 651079.3 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