searchQuery

Benchmark created by Sebastian on


Setup

var query = "ipod",
      lastSearch = "ipod mini";

Test runner

Ready to run.

Testing in
TestOps/sec
Stored RegExp
var regExp = new RegExp('^' + query + '| ' + query);

if (regExp.exec(lastSearch)) {
  console.log('Encontrado')
}
ready
indexOf
if (lastSearch.indexOf(query) > -1) {
  console.log('Encontrado');
}
ready

Revisions

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

  • Revision 1: published by Sebastian on