Replace vs substr (v2)

Revision 2 of this benchmark created on


Setup

const GROUP_SUFFIX = "@360learning.com"
const groupSuffixLength = "@360learning.com".length;

Test runner

Ready to run.

Testing in
TestOps/sec
With replace
"group@360learning.com".replace(GROUP_SUFFIX, "");
ready
With slice
"group@360learning.com".slice(0, -groupSuffixLength);
ready

Revisions

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