text content (v9)

Revision 9 of this benchmark created by aeosynth on


Preparation HTML

<div id="text">content to be retrieved</div>
<script>
  var elem = document.getElementById("text");
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
read innerHTML
var x = elem.innerHTML;
ready
read textContent
var x = elem.textContent;
ready
read data
var x = elem.firstChild.data;
ready
write innerHTML
elem.innerHTML = 'written content'
ready
write textContent
elem.textContent = 'written content'
ready
write data
elem.firstChild.data = 'written content'
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by galambalazs on
  • Revision 2: published by galambalazs on
  • Revision 3: published by galambalazs on
  • Revision 9: published by aeosynth on
  • Revision 10: published by Mayhem on
  • Revision 11: published on