valhooks vs val (v11)

Revision 11 of this benchmark created on


Description

Compares the performance of the newest valHooks proposal versus the old val.

Preparation HTML

<script src="https://code.jquery.com/jquery-1.7.1.js"></script>
<script>
  var newVal = jQuery.noConflict();
</script>
<script src="https://code.jquery.com/jquery-1.8.3.js"></script>
<input id="one" type="text" value="foo">
<input id="two" type="text" value="foo">
<script>
  var $foo = $('#one'),
      $newFoo = newVal('#two');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
get
$foo.val();
ready
set
$foo.val('wow');
ready
new get
$newFoo.val();
ready
new set
$newFoo.val('wow');
ready

Revisions

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