Popup creation

JavaScript performance comparison

Test case created by Gabriel Schulhof


How quickly are popups created

Preparation code

<script src="https://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>
Benchmark.prototype.teardown = function() {
    $( ":mobile-popup" ).popup( "destroy" );
    $( ":mobile-popup2" ).popup2( "destroy" );

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();
Modified popup
$( "#thePopup" ).popup2();

Compare results of other browsers


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

Comment form temporarily disabled.

Add a comment