RexEx Match vs indexOf

Benchmark created on


Preparation HTML

<script>
  var scheme = 'http';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
RegEx Match
scheme && !scheme.match(/https?/i)
ready
indexOf
scheme && scheme.toLowerCase().indexOf('http') !== 0
ready

Revisions

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