Property access (DOM vs object) (v2)

Revision 2 of this benchmark created by Mourner on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
DOM
el.foo;
el.foo = 'bar';
ready
Object
obj.foo;
obj.foo = 'bar';
ready

Revisions

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