Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Firefox 91
Mac OS X 10.15
Desktop
3 years ago
Test name Executions per second
appendChild after createElement 1174.9 Ops/sec
appendChild after getElementById 912.6 Ops/sec
appendChild after createElement (with cloneNode) 1791.3 Ops/sec
appendChild after getElementById (with cloneNode) 1996.0 Ops/sec
HTML Preparation code:
Tests:
  • appendChild after createElement

  • appendChild after getElementById

  • appendChild after createElement (with cloneNode)

  • appendChild after getElementById (with cloneNode)

  • appendChild to fragment, then append after createElement

  • appendChild to fragment, then append after getElementById

  • appendChild to fragment, then append after createElement (with cloneNode)

  • appendChild to fragment, then append after getElementById (with cloneNode)