HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Script Preparation code:
 
var string1 = "Lucy Aligtore";
var string2 = "Fridolin Bauer";
Tests:
  • Locale compare

     
    string1.localeCompare(string2);
  • My version

    x
     
    const s1 = string1 ? [...string1.toLowerCase()].reduce((prev, char) => prev + char.charCodeAt(0), 0) : 0;
    const s2 = string2 ? [...string2.toLowerCase()].reduce((prev, char) => prev + char.charCodeAt(0), 0) : 0;
    string1 && string2 ? Math.sign(s1 - s2) : Math.sign(s2 - s1);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Locale compare
    My version

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Chrome 133 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
Locale compare 102183960.0 Ops/sec
My version 5147244.0 Ops/sec