jquery Data vs. js data (v2)

Revision 2 of this benchmark created by sandeep on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<ul>
  <li id="onselct">
    First Element
  </li>
</ul>

Test runner

Ready to run.

Testing in
TestOps/sec
jqeury data
$("#onselct")[0]['data'] = {
  'test': 'testval'
}
var nb = $('#onselct')[0]['data'].test;
ready
js data
$("#onselct").data({
  'test': 'testval'
});
var nb = $("#onselct").data('test')
ready

Revisions

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