HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 71 community runs

Desktop Results:
Chrome 55 runs
replaceWith
19/s
replaceChild
14/s

Fastest: replaceWith (1.3x faster)

View exact numbers
  • replaceWith: 19 ops/sec
  • replaceChild: 14 ops/sec
Firefox 16 runs
replaceWith
73/s
replaceChild
59/s

Fastest: replaceWith (1.2x faster)

View exact numbers
  • replaceWith: 73 ops/sec
  • replaceChild: 59 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
    replaceWith
    replaceChild

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 7 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36
Chrome 144 on Windows
View result in a separate tab
replaceWith
4/s
replaceChild
3/s
View exact numbers
Test name Executions per second
replaceWith 4 Ops/sec
replaceChild 3 Ops/sec