Popup creation

JavaScript performance comparison

Test case created by Gabriel Schulhof

Info

How quickly are popups created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://babulina.go-nix.ca:8080/nix/jqm/popup.js"></script>
<link rel="stylesheet" href="http://babulina.go-nix.ca:8080/nix/jqm/css/themes/default/jquery.mobile.css" />
<div data-role="popup" id="thePopup">
  <p>This is a popup</p>
</div>
<script>
Benchmark.prototype.teardown = function() {
    $( ":mobile-popup" ).popup( "destroy" );
    $( ":mobile-popup2" ).popup2( "destroy" );
};
</script>

Preparation code output

This is a popup

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Original popup
$( "#thePopup" ).popup();
pending…
Modified popup
$( "#thePopup" ).popup2();
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:

1 comment

Erick Ribeiro commented :

Please run my test: http://jsperf.com/if-vs-else-if/2

Add a comment