regexp vs indexOf - case insensitive (v166)

Revision 166 of this benchmark created by Shahar on


Preparation HTML

<script>
  var str = "HeLlO WoRlD!";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
var patt = new RegExp(/world/i);
var res = patt.test(str);
 
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.