DOM vs object (v3)

Revision 3 of this benchmark created by alien on


Preparation HTML

<div id="el"></div>
<script>
  var el = document.getElementById('el');
  var obj = {
   foo: 'bar'
  };
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
DOM
document.getElementById('el').foo = 'bar';
ready
DOM (cached)
el.foo = 'bar';
ready
Object
obj.foo = 'bar';
ready

Revisions

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