valhooks vs val

Benchmark created by timmywil on


Description

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

Preparation HTML

<script src="http://timmywillison.com/jquery/valhooks_modest/jquery.min.js"></script>
<script>
  var tw = jQuery.noConflict();
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<input id="one" type="text" value="foo">
<input id="two" type="text" value="foo">
<script>
  var $foo = $('#one'),
      $twFoo = tw('#two');
</script>

Test runner

Ready to run.

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

Revisions

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