string compare perf test

JavaScript performance comparison

Test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
lowercased indexof - mid size
var data = "The Modern.ie scan analyzes the HTML, CSS, and JavaScript of a site or application to determine whether it is using good development practices. It warns about practices such as browser `userAgent` sniffing, use of ActiveX, or APIs specific to legacy versions of Internet Explorer."

data.toLowerCase().indexOf('Explorer'.toLowerCase());
 
pending…
search - mid size
var data = "The Modern.ie scan analyzes the HTML, CSS, and JavaScript of a site or application to determine whether it is using good development practices. It warns about practices such as browser `userAgent` sniffing, use of ActiveX, or APIs specific to legacy versions of Internet Explorer."

data.search(/Explorer/i);
 
pending…
lowercased indexof - small size
var data = "legacy versions of Internet Explorer."

data.toLowerCase().indexOf('Explorer'.toLowerCase());
 
pending…
search - small size
var data = "legacy versions of Internet Explorer."

data.search(/Explorer/i);
 
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

1 comment

Anonymous commented :

Wow, I never would have expected a RegExp to be faster here, great bench!

Add a comment