regexp vs indexOf (case insensitive) (v152)

Revision 152 of this benchmark created by Yogesh Mangaj on


Preparation HTML

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

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
str.match(/World/i);
ready
indexOf
str.toLowerCase().indexOf("World".toLowerCase());
ready

Revisions

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