replace string vs regex vs new RegExp (v2)

Revision 2 of this benchmark created by harth on


Test runner

Ready to run.

Testing in
TestOps/sec
Regex
"xxxxxxxxxabcxxxxxxabcxx".replace(/abc/g, "def")
ready
String
"xxxxxxxxxabcxxxxxxabcxx".replace("abc", "def")
ready
new RegExp
"xxxxxxxxxabcxxxxxxabcxx".replace(new RegExp("abc", "g"), "def")
ready

Revisions

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