Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Chrome 53
Linux
Other
8 years ago
Test name Executions per second
jQuery(jQuery.clone()) 79309.5 Ops/sec
jQuery(jQuery).clone() 94983.4 Ops/sec
jQuery(JavaScript).clone() 157603.7 Ops/sec
jQuery(JavaScript.cloneNode.content) 317316.3 Ops/sec
jQuery(JavaScript.content.cloneNode) 400074.9 Ops/sec
Pure JavaScript.cloneNode.content 405684.7 Ops/sec
Pure JavaScript.content.cloneNode 520966.1 Ops/sec
jQuery(id) 1008543.9 Ops/sec
querySelector(id) 2820824.8 Ops/sec
getElementById(id) 3394817.2 Ops/sec
HTML Preparation code:
Tests:
  • jQuery(jQuery.clone())

  • jQuery(jQuery).clone()

  • jQuery(JavaScript).clone()

  • jQuery(JavaScript.cloneNode.content)

  • jQuery(JavaScript.content.cloneNode)

  • jQuery(getElementById.content.cloneNode)

  • Pure JavaScript.cloneNode.content

  • Pure JavaScript.content.cloneNode