Replace vs substring

Benchmark created on


Setup

var tmp = "i18n-veryVeryLongName";
    var newTmp = "";

Test runner

Ready to run.

Testing in
TestOps/sec
replace
newTmp = tmp.replace("i18n-", "");
ready
substring
newTmp = tmp.substring(5);
ready
substr
newTmp = tmp.substr(5)
ready

Revisions

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