regexp vs indexOf (v85)

Revision 85 of this benchmark created by Dean Landolt on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
String.prototype.match
str.match(/world/);
ready
RegExp.prototype.test
/world/.test(str)
ready
String.prototype.indexOf
~str.indexOf("world");
ready

Revisions

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