regexp vs indexOf (case insensitive) (v158)

Revision 158 of this benchmark created on


Preparation HTML

<script>
  var str = "{'i':105,'p':104,'y':13,'l':'BBgio9c','h':1,'v':'news','c':'newscrime','o':1,'a':'triptych '}";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
str.match(/'a':'halfpane|'a':'head-to-head|'a':'mosaic|'a':'triptych/);
ready
indexOf
str.indexOf("'a':'halfpane") || str.indexOf("'a':'head-to-head") || str.indexOf("'a':'mosaic") || str.indexOf("'a':'triptych");
ready

Revisions

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