substring one letter (v50)

Revision 50 of this benchmark created by noway on


Preparation HTML

<script>
  var str = "This is a simple test!",
      r = new RegExp('!');
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
regex
var c = /!/.test(str)
ready
indexof
var c = ~str.indexOf('!')
ready
RegExp
var c = (new RegExp('!')).test(str);
ready
Cached RegExp
var c = r.test(str);
ready

Revisions

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