TEST

Benchmark created on


Setup

let a = "";
let b = "";


function r(str, ...args) { 
    for(let i = 0; i < args.length; ++i) {
    	a+=str[i];
    	a+=args[i];
    }
    a += str[args.length];
 }
function x(...args) {
   b += args[0];
   for(let i = 2; i < args.length; i+=2) {
    	b+=args[i-1];
    	b+=args[i];
    }
}

Test runner

Ready to run.

Testing in
TestOps/sec
A
for(let i = 0; i < 1000; ++i)

    r`a${i}b`
ready
B
for(let i = 0; i < 1000; ++i)

    x("a", i, "b");
ready

Revisions

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