append

JavaScript performance comparison

Test case created by string test

Info

I hate append

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
 
<script>
Benchmark.prototype.teardown = function() {
    appendi.remove();
};
</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
2variable
var appendi = $("<div id='cacca'><div id='de-top'><a href='#' class='homeLink'><span class='logo'><strong>pippo</strong> Manager</span></a><div class='btn-toolbar' style='margin-top: 35px'></div></div></div>");
var moreappendi = $('<span id="morecrap"/>');
appendi.append(moreappendi);
moreappendi.text('innercacca');
$('body').append(appendi);
pending…
1variable
var appendi = $("<div id='cacca'><div id='de-top'><a href='#' class='homeLink'><span class='logo'><strong>pippo</strong> Manager</span></a><div class='btn-toolbar' style='margin-top: 35px'></div></div><span id='morecrap'></span></div>");
$('#morecrap').text('innercacca');
$('body').append(appendi);
pending…
3variable
var appendi = $("<div id='cacca'><div id='de-top'><a href='#' class='homeLink'><span class='logo'><strong>pippo</strong> Manager</span></a><div class='btn-toolbar' style='margin-top: 35px'></div></div><span id='morecrap'></span></div>");
$('body').append(appendi);
$('#morecrap').text('innercacca');
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