HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 63 community runs

Desktop Results:
Chrome 42 runs
replaceChild
796K/s
replaceChildren
494K/s
append documentFragment
382K/s

Fastest: replaceChild (2.1x faster)

View exact numbers
  • replaceChild: 796,001 ops/sec
  • replaceChildren: 493,895 ops/sec
  • append documentFragment: 381,782 ops/sec
Firefox 15 runs
replaceChild
614K/s
replaceChildren
357K/s
append documentFragment
10K/s

Fastest: replaceChild (59.0x faster)

View exact numbers
  • replaceChild: 613,886 ops/sec
  • replaceChildren: 356,646 ops/sec
  • append documentFragment: 10,402 ops/sec
Mobile Results:
Safari 6 runs
replaceChild
2.6M/s
replaceChildren
2.4M/s
append documentFragment
1.2M/s

Fastest: replaceChild (2.2x faster)

View exact numbers
  • replaceChild: 2,594,104 ops/sec
  • replaceChildren: 2,400,504 ops/sec
  • append documentFragment: 1,191,640 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    replaceChild
    replaceChildren
    append documentFragment

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:151.0) Gecko/20100101 Firefox/151.0
Firefox 151 on Mac OS X 10.15
View result in a separate tab
replaceChild
250K/s
replaceChildren
120K/s
append documentFragment
10K/s
View exact numbers
Test name Executions per second
replaceChild 249,575 Ops/sec
replaceChildren 119,923 Ops/sec
append documentFragment 10,402 Ops/sec