removeAttr with check for attr 2

JavaScript performance comparison

Test case created by Orkel

Preparation code

<script src="//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 bla="bla"></div>
</div>
<script>
Benchmark.prototype.setup = function() {
    var currentDiv = $current( ".parent > div" ),
    testDiv = $test( ".parent > div" );
};
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
current removeAttr
currentDiv.removeAttr( "bla blah" ).attr( "bla", "bla" );
pending…
test removeAttr
testDiv.removeAttr( "bla blah" ).attr( "bla", "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. Here’s a list of current revisions for this page:

0 comments

Add a comment