one by one manual vs replaceChildren mass vs replaceWith first (firstChild)Fastest: one by one manual (1.1x faster)
610 ops/sec
554 ops/sec
547 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| one by one manual | |
| replaceChildren mass | |
| replaceWith first (firstChild) |
| Test name | Executions per second |
|---|---|
| ✓ one by one manual | 982 Ops/sec |
| replaceChildren mass | 843 Ops/sec |
| replaceWith first (firstChild) | 796 Ops/sec |