regexp vs indexOf (v40)

Revision 40 of this benchmark created on


Preparation HTML

<script>
var str = "hello world!";
var reg = /world/
reg.compile(reg);

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
str.match(/world/);
ready
indexOf
str.indexOf("world");
ready
str.match(reg);
ready
reg.test(str);
ready
reg.exec(str);
ready

Revisions

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