String concat

JavaScript performance comparison

Test case created

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Concat
var str = '';
str += 'one;';
str += 'two;';
str += 'three;';
str += 'four;';
str += 'six;';
str += 'seven;';
str += 'eight;';
str += 'nine;';
str += 'ten';
pending…
Concat One Line
var str = '';
str += 'one;'
    + 'two;'
    + 'three;'
    + 'four;'
    + 'five;'
    + 'six;'
    + 'seven;'
    + 'eight;'
    + 'nine;'
    + 'ten';
pending…
Array
var str = new Array();
str.push('one');
str.push('two');
str.push('three');
str.push('four');
str.push('five');
str.push('six');
str.push('seven');
str.push('eight');
str.push('nine');
str.push('ten');
str = str.join(';');
pending…
Array 2
var str = new Array();
str[] = 'one';
str[] = 'two';
str[] = 'three';
str[] = 'four';
str[] = 'five';
str[] = 'six';
str[] = 'seven';
str[] = 'eight';
str[] = 'nine';
str[] = 'ten';
str = str.join(';');
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