startsWith Regex vs indexOf (v2)

Revision 2 of this benchmark created by Tim on


Test runner

Ready to run.

Testing in
TestOps/sec
Regex
/^\./.test(".namespace");
/^\./.test("namespace");
ready
indexOf
".namespace".indexOf(".") === 0;
"namespace".indexOf(".") === 0;
ready

Revisions

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