localeCompare w/ toLowerCase() (v14)

Revision 14 of this benchmark created on


Description

Compares using string.localeCompare vs. a comparator string with all string vars getting .toLowerCase() called on them for all operations.

Setup

var s1 = "first";
    var s2 = "second";

Test runner

Ready to run.

Testing in
TestOps/sec
localeCompare
s1.toLowerCase().localeCompare(s2.toLowerCase())
ready
Custom
s1.toLowerCase() < s2.toLowerCase() ? -1 : s1.toLowerCase() > s2.toLowerCase() ? 1 : 0;
ready

Revisions

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