replaceWith vs replaceWith

JavaScript performance comparison

Test case created by orkel

Preparation code

<script src="http://code.jquery.com/jquery-git.js"></script>
<script>
current = jQuery.noConflict();
</script>
<script src="http://dl.dropbox.com/u/7425859/jquery-replace-with.js"></script>
<script>
test = jQuery.noConflict();
</script>

<div>
<p id="with-sibling"></p>
<p></p>
</div>

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
current("#with-sibling").replaceWith("<p id='with-sibling'></p>");
pending…
test
test("#with-sibling").replaceWith("<p id='with-sibling'></p>");
pending…

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

Compare results of other browsers

0 comments

Add a comment