String Insertion vs Concatenation

Benchmark created by Sacha on


Setup

var text = 'I am a text.';

Test runner

Ready to run.

Testing in
TestOps/sec
Insertion
var result = [text.slice(0, 6), ' plain', text.slice(6)].join('');
ready
Concatenation
var result = text.slice(0, 6) + ' plain' + text.slice(6);
ready

Revisions

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