regexp test vs indexOf (v96)

Revision 96 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.toLowerCase().indexOf("world");
ready

Revisions

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