valhooks vs val

JavaScript performance comparison

Revision 2 of this test case created by timmywil and last updated

Preparation code

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

Preparation code output

<script> var newVal = jQuery.noConflict(); </script> <script src="https://code.jquery.com/jquery-1.6.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

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
get
$foo.val();
pending…
set
$foo.val('wow');
pending…
new get
$newFoo.val();
pending…
new set
$newFoo.val('wow');
pending…

Compare results of other browsers

Revisions

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

0 Comments