empty remove

JavaScript performance comparison

Test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div id="meh">
<ol>
<li>book1</li>
<li>book2</li>
</ol>
<ol>
<li>book1</li>
<li>book2</li>
</ol>
<ol>
<li>book1</li>
<li>book2</li>
</ol>
<ol>
<li>book1</li>
<li>book2</li>
<li><ul><li>meh1</li>
<li>meh2</li>
<li>meh3</li>
</ul></li>
</ol>
</div>

Preparation code output

  1. book1
  2. book2
  1. book1
  2. book2
  1. book1
  2. book2
  1. book1
  2. book2
    • meh1
    • meh2
    • meh3

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
no empty
$("#meh").remove();
pending…
empty
$("#meh").empty().remove();
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