regexp vs indexOf (v46)

Revision 46 of this benchmark created on


Preparation HTML

<script>
  var str = "hello world!";
</script>

Setup

var r = /world/;

Test runner

Ready to run.

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

Revisions

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