jQuery show/hide vs slideUp/slideDown

Benchmark created by DespotMagic on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<div style="display:none;">
  before div
  <div id="testDiv">
  This is text!! <br>
  This is text!! <br>
  This is text!! <br>
  This is text!! <br>
  </div>
  after div
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
show() / hide()
$("#testDiv").hide();
$("#testDiv").show();
ready
slideUp() / slideDown()
$("#testDiv").slideDown();
$("#testDiv").slideUp();
ready

Revisions

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

  • Revision 1: published by DespotMagic on