Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Chrome 65
Windows
Other
6 years ago
Test name Executions per second
1 div with javascript 1052244.6 Ops/sec
1 div with jquery selector 1112780.4 Ops/sec
2 divs with javascript. Add with jquery 256721.1 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 246596.6 Ops/sec
2 divs with javascript. Add with array 574029.4 Ops/sec
2 divs with 2 jquery selectors. Add with array 346882.9 Ops/sec
2 divs with single jquery selector 277.6 Ops/sec
1 div with jquery selector with context 482436.0 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