Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
HTML manipulation with and without requestAnimationFrame
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
With requestAnimationFrame
3361691.2 Ops/sec
Without requestAnimationFrame
11326998.0 Ops/sec
HTML Preparation code:
<div id='messages'></div>
Script Preparation code:
const html = []; for(i=0; i<1000; i++) { html.push("<span>Text</span>"); } document.getElementById("messages").insertAdjacentHTML('beforeend', html)
Tests:
With requestAnimationFrame
const messagesDiv = document.getElementById("messages"); function removeChildWithAnimation() { if (messagesDiv.firstChild) { messagesDiv.removeChild(messagesDiv.firstChild); requestAnimationFrame(removeChildWithAnimation); // Call recursively until all children are removed } } requestAnimationFrame(removeChildWithAnimation);
Without requestAnimationFrame
const messagesDiv = document.getElementById("messages"); while (messagesDiv.firstChild) { messagesDiv.removeChild(messagesDiv.firstChild); }