regexp vs indexOf (v108)

Revision 108 of this benchmark created by Aaron on


Preparation HTML

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

Test runner

Ready to run.

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

Revisions

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