removeAttr with check for attr

JavaScript performance comparison

Test case created by Orkel

Preparation code

<script src="https://code.jquery.com/jquery-1.7b1.js"></script>
<script>
var $current = jQuery.noConflict(); 
</script>

<script src="https://docs.google.com/uc?id=0B6yiDAQGhvdFOWJlNjVjYzItNmQzYS00ZWI4LWEyM2QtNmVlZThjNzY5MDJk&export=download"></script>
<script>
var $test = jQuery.noConflict(); 
</script>
<div class="parent">
<div></div>
</div>
      
<script>
Benchmark.prototype.setup = function() {
  var currentDiv = $current( ".parent > div" ),
  testDiv = $test( ".parent > div" );

};
</script>

Preparation code output

<script> var $current = jQuery.noConflict(); </script> <script src="https://docs.google.com/uc?id=0B6yiDAQGhvdFOWJlNjVjYzItNmQzYS00ZWI4LWEyM2QtNmVlZThjNzY5MDJk&export=download"></script> <script> var $test = jQuery.noConflict(); </script> <div class="parent"> <div></div> </div>

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
current removeAttr
currentDiv.removeAttr( "bla" );
pending…
test removeAttr
testDiv.removeAttr( "bla" );
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