jQuery Object creation

JavaScript performance comparison

Test case created

Preparation code

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

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
By Objects
var menu = $('<div id="hovermenu class="initial">');
var tl = $('<div class="hm-btn tl">').append('<div class="hm-pie">').append('<div class="hm-pie">');
var tr = $('<div class="hm-btn tl">').append('<div class="hm-pie">').append('<div class="hm-pie">');
var br = $('<div class="hm-btn tl">').append('<div class="hm-pie">').append('<div class="hm-pie">');
var bl = $('<div class="hm-btn tl">').append('<div class="hm-pie">').append('<div class="hm-pie">');
pending…
String
var menu = $('<div id="hovermenu" class="initial"><div class="hm-btn tl"><div class="hm-pie"></div><div class="hm-text"><i class="icon-thumbs-up"></i>LIKE</div></div><div class="hm-btn tr"><div class="hm-pie"></div><div class="hm-text"><i class="icon-share-alt"></i>SHARE</div></div><div class="hm-btn bl"><div class="hm-pie"></div><div class="hm-text"><i class="icon-home"></i>HOME</div></div><div class="hm-btn br"><div class="hm-pie"></div><div class="hm-text"><i class="icon-github"></i>FORK</div></div></div>');

var tr = menu.children('.tr');
var tl = menu.children('.tl');
var br = menu.children('.br');
var bl = menu.children('.bl');
pending…
new
var menu = $('<div id="hovermenu" class="initial">');
                        var btnHtmlStr = "";
                        var btnInnerHtml = '<div class="hm-pie"></div><div class="hm-text"></div>';
                        var t = "tb";
                        var left = "rl";
                        for(var tb in t){
                                for(var lr in left){
                                        btnHtmlStr+='<div class="hm-btn '+t[tb]+left[lr]+'">'+btnInnerHtml+'</div>';
                                }
                        }
                        menu.append(btnHtmlStr);
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