data-attr-set (v9)

Revision 9 of this benchmark created by Christopher Froehlich on


Description

Compares actual data set performance.

Preparation HTML

<div id="div"></div>
<script>
var div = document.getElementById('div');
</script>

Teardown


    div.setAttribute('data-yo', null);
    div.setAttribute('data-ma', null);
    div.setAttribute('data-la', null);
  

Test runner

Ready to run.

Testing in
TestOps/sec
setAttribute
div.setAttribute('data-yo', 'yo');
div.setAttribute('data-ma', 'ma');
div.setAttribute('data-la', 'la');
ready
dataset
div.dataset.yo = 'yo';
div.dataset.ma = 'ma'; 
div.dataset.la = 'la';
ready

Revisions

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