jQuery .data() performance vs .bind() (v48)

Revision 48 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<input type="text" id="theInput" value="foo" style="background-color:red; border:1px solid yellow"></input>
<script>
  var dom= document.getElementById("theInput");
  var $dom= $(dom);
  $dom.data('min-height', '30').bind('min-height', function(){return '30';});
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
data get
$dom.data('min-height');
ready
bind get
$dom.trigger('min-height');
ready

Revisions

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