test VS indexOf

Benchmark created on


Setup

var re = /^chickens/;
    
    var str = 'chickens'
    
    var testing = 'chickens all the way down';

Test runner

Ready to run.

Testing in
TestOps/sec
test
re.test(testing);
ready
indexOf
testing.indexOf(str) !== -1;
ready

Revisions

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