Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
Chrome 54
Linux
Other
8 years ago
Test name Executions per second
1 div with javascript 1676564.1 Ops/sec
1 div with jquery selector 1739684.6 Ops/sec
2 divs with javascript. Add with jquery 369843.8 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 350535.5 Ops/sec
2 divs with javascript. Add with array 879000.6 Ops/sec
2 divs with 2 jquery selectors. Add with array 533744.6 Ops/sec
2 divs with single jquery selector 364.5 Ops/sec
1 div with jquery selector with context 658694.4 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