test vs indexof test (v2)

Revision 2 of this benchmark created by Famlam on


Setup

var str = "This is just a random String";

Test runner

Ready to run.

Testing in
TestOps/sec
test
/just/ig.test(str)
ready
indexOf
str.indexOf('just') > -1
ready
test (no match)
/qwerty/ig.test(str)
ready
indexOf (no match)
str.indexOf('querty') > -1
ready
search
str.search(/just/) > -1
ready
search (no match)
str.search(/qwerty/) > -1
ready

Revisions

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