regexp test vs indexOf (v125)

Revision 125 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
reg.test(str);
ready
indexOf
str.indexOf(substr);
ready

Revisions

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