files-community / Files

A modern file manager that helps users organize their files and folders.
https://files.community
MIT License
34.78k stars 2.21k forks source link

Code Quality: Improve string comparer performance #16523

Open viruseg opened 4 days ago

viruseg commented 4 days ago

New comparator is slightly faster than [DllImport(“api-ms-win-core-string-l1-1-0.dll”)].CompareStringEx. And supports Arm. Previously, a string comparer was used for Arm without proper support for natural comparison.

Method Mean Error StdDev Allocated
Test_api-ms-win-core-string-l1-1-0.dll 1.185 ms 0.0095 ms 0.0084 ms 89 B
Test_NaturalComparer 1.072 ms 0.0073 ms 0.0065 ms 89 B
yaira2 commented 4 days ago

@XTorLukas fyi