innerHTML vs removeChild vs removeChild backwards vs innerTextFastest: removeChild (2.5x faster)
7,880,482 ops/sec
7,830,864 ops/sec
4,235,333 ops/sec
3,168,978 ops/sec
Fastest: removeChild (1.5x faster)
6,088,562 ops/sec
6,020,191 ops/sec
4,640,878 ops/sec
4,076,102 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| innerHTML | |
| removeChild | |
| removeChild backwards | |
| innerText |
| Test name | Executions per second |
|---|---|
| ✓ removeChild | 19,418,184 Ops/sec |
| removeChild backwards | 18,649,826 Ops/sec |
| innerText | 5,976,126 Ops/sec |
| innerHTML | 2,455,344 Ops/sec |