Run details:
Mozilla/5.0 (Windows NT 10.0.14393; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2950.4 Safari/537.36
Chrome 57
Windows
Other
8 years ago
Test name Executions per second
1 div with javascript 1050740.6 Ops/sec
1 div with jquery selector 1262854.8 Ops/sec
2 divs with javascript. Add with jquery 156389.4 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 147930.0 Ops/sec
2 divs with javascript. Add with array 587341.0 Ops/sec
2 divs with 2 jquery selectors. Add with array 381179.8 Ops/sec
2 divs with single jquery selector 407.7 Ops/sec
1 div with jquery selector with context 424326.2 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