regexp test vs indexOf (v95)

Revision 95 of this benchmark created on


Preparation HTML

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

Test runner

Ready to run.

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

Revisions

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