HTML Preparation code:
Script Preparation code:
Tests:

Historical Performance Data aggregated from 46 community runs

Desktop Results:
Chrome 30 runs
firstChild.remove
16.1M/s
Remove lastChild
16.0M/s
Remove firstChild
15.8M/s
innerHTML
7.6M/s
innerText
7.3M/s
textContent
6.9M/s
range
2.1M/s

Fastest: firstChild.remove (7.5x faster)

View exact numbers
  • firstChild.remove: 16,097,530 ops/sec
  • Remove lastChild: 15,965,818 ops/sec
  • Remove firstChild: 15,821,484 ops/sec
  • innerHTML: 7,571,229 ops/sec
  • innerText: 7,328,925 ops/sec
  • textContent: 6,850,505 ops/sec
  • range: 2,141,762 ops/sec
Firefox 16 runs
firstChild.remove
5.4M/s
Remove firstChild
5.3M/s
Remove lastChild
5.3M/s
textContent
4.2M/s
innerHTML
3.8M/s
innerText
3.8M/s
range
1.5M/s

Fastest: firstChild.remove (3.6x faster)

View exact numbers
  • firstChild.remove: 5,366,172 ops/sec
  • Remove firstChild: 5,280,378 ops/sec
  • Remove lastChild: 5,269,151 ops/sec
  • textContent: 4,249,256 ops/sec
  • innerHTML: 3,838,541 ops/sec
  • innerText: 3,787,302 ops/sec
  • range: 1,488,472 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
    Remove firstChild
    Remove lastChild
    innerHTML
    innerText
    textContent
    firstChild.remove
    range

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Chrome 148 on Mac OS X 10.15.7
View result in a separate tab
firstChild.remove
45.5M/s
Remove lastChild
45.2M/s
Remove firstChild
45.1M/s
innerText
17.2M/s
textContent
9.2M/s
innerHTML
8.7M/s
range
5.0M/s
View exact numbers
Test name Executions per second
firstChild.remove 45,451,428 Ops/sec
Remove lastChild 45,172,348 Ops/sec
Remove firstChild 45,105,476 Ops/sec
innerText 17,209,156 Ops/sec
textContent 9,193,548 Ops/sec
innerHTML 8,677,073 Ops/sec
range 4,956,853 Ops/sec