regexp vs indexOf (v98)

Revision 98 of this benchmark created by PiranhaGreg on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
str.match(/w|o|r|l|d/);
ready
indexOf
str.indexOf("w");
str.indexOf("o");
str.indexOf("r");
str.indexOf("l");
str.indexOf("d");
ready

Revisions

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