Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/55.0.2883.79 Mobile/14C92 Safari/602.1
Chrome Mobile iOS 55
iOS 10.2
iPhone
7 years ago
Test name Executions per second
1 div with javascript 810117.8 Ops/sec
1 div with jquery selector 874994.7 Ops/sec
2 divs with javascript. Add with jquery 186646.3 Ops/sec
2 divs with 2 jquery selectors. Add with jquery 184082.8 Ops/sec
2 divs with javascript. Add with array 355565.2 Ops/sec
2 divs with 2 jquery selectors. Add with array 244083.0 Ops/sec
2 divs with single jquery selector 342.1 Ops/sec
1 div with jquery selector with context 382527.7 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