substr-with-arr

Benchmark created by artjock on


Setup

var a = '                                                         ';

Test runner

Ready to run.

Testing in
TestOps/sec
substr
var r = a.substr(0, 10);
ready
arr
var r = Array(10-1).join(' ');
ready
substring
var r = a.substring(0, 10);
ready
slice
var r = a.slice(0, 10);
ready

Revisions

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