are you kidding me? (v2)

Revision 2 of this benchmark created on


Setup

//
    // To be used to prevent compiling out code without side-effect
    //
    function noop(){}
    var part = 'abc';

Test runner

Ready to run.

Testing in
TestOps/sec
insane
var string = Array();
string.push(part);
string.push(part);
string.push(part);
string.push(part);
string.push(part);

// make sure it doesn't compile out
// costs the pagan compiler gods a function call
noop(string.join(""));
ready
not insane but not advisable
var string = [ part, part, part, part, part ].join("");

// make sure it doesn't compile out
// costs the pagan compiler gods a function call
noop(string);
ready
is it?
var string = part;
string += part;
string += part;
string += part;
string += part;

// make sure it doesn't compile out
// costs the pagan compiler gods a function call
noop(string);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.