regexp test vs indexOf (v119)

Revision 119 of this benchmark created on


Preparation HTML

<script>
  var str = "https://instagram.com/accounts/login/ajax";
  var reg = /^https:\/\/instagram\.com\/accounts\/login/;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Regexp
reg.test(str);
ready
indexOf
str.indexOf("https://instagram.com/accounts/login");
ready

Revisions

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