innerHTML vs removeChild (firstChild and lastChild) (version: 0)
From http://jsfiddle.net/6K6mv/5/ to test the answers to this StackOverflow question: https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
Comparing performance of: innerHTML vs removeChild( firstChild ) vs removeChild( lastChild )
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
innerHTML
removeChild( firstChild )
removeChild( lastChild )
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
2 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36