bt90
05cc6b0f43
chore(fs): speed up case normalization (#10013)
### Purpose
Resurrecting https://github.com/syncthing/syncthing/pull/9365
### Testing
Current benchmark results:
```
goos: linux
goarch: amd64
pkg: github.com/syncthing/syncthing/lib/fs
cpu: AMD EPYC 7763 64-Core Processor
│ ../old.txt │ ../new.txt │
│ sec/op │ sec/op vs base │
UnicodeLowercase/ASCII_lowercase-4 43.68n ± 4% 12.19n ± 1% -72.09% (p=0.000 n=10)
UnicodeLowercase/ASCII_mixedcase_start-4 200.65n ± 2% 59.49n ± 3% -70.35% (p=0.000 n=10)
UnicodeLowercase/ASCII_mixedcase_end-4 95.50n ± 2% 59.10n ± 2% -38.12% (p=0.000 n=10)
UnicodeLowercase/Latin1_lowercase-4 122.5n ± 1% 131.4n ± 1% +7.27% (p=0.000 n=10)
UnicodeLowercase/Latin1_mixedcase_start-4 339.9n ± 2% 309.2n ± 1% -9.05% (p=0.000 n=10)
UnicodeLowercase/Latin1_mixedcase_end-4 183.6n ± 2% 174.3n ± 1% -5.04% (p=0.000 n=10)
UnicodeLowercase/Unicode_lowercase-4 456.6n ± 1% 440.5n ± 1% -3.53% (p=0.000 n=10)
UnicodeLowercase/Unicode_mixedcase_start-4 625.9n ± 1% 595.6n ± 1% -4.83% (p=0.000 n=10)
UnicodeLowercase/Unicode_mixedcase_end-4 516.2n ± 1% 495.5n ± 1% -4.02% (p=0.000 n=10)
geomean 214.1n 150.4n -29.72%
│ ../old.txt │ ../new.txt │
│ B/op │ B/op vs base │
UnicodeLowercase/ASCII_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/ASCII_mixedcase_start-4 24.00 ± 0% 24.00 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/ASCII_mixedcase_end-4 24.00 ± 0% 24.00 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_mixedcase_start-4 32.00 ± 0% 32.00 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_mixedcase_end-4 32.00 ± 0% 32.00 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_mixedcase_start-4 48.00 ± 0% 48.00 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_mixedcase_end-4 48.00 ± 0% 48.00 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
│ ../old.txt │ ../new.txt │
│ allocs/op │ allocs/op vs base │
UnicodeLowercase/ASCII_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/ASCII_mixedcase_start-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/ASCII_mixedcase_end-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_mixedcase_start-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Latin1_mixedcase_end-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_lowercase-4 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_mixedcase_start-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
UnicodeLowercase/Unicode_mixedcase_end-4 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
I think the `+7%` for the lowercase Latin1 testcase is easily outweighed
by the ASCII and unicode improvements 🙂
2025-04-01 13:41:57 +02:00
..
2021-08-17 10:10:41 +02:00
2021-08-17 10:10:41 +02:00
2021-08-17 10:10:41 +02:00
2021-08-17 10:10:41 +02:00
2020-08-07 07:47:48 +02:00
2022-09-14 09:50:55 +02:00
2023-10-21 08:24:29 +02:00
2021-08-17 10:10:41 +02:00
2024-11-19 11:32:56 +01:00
2021-08-17 10:10:41 +02:00
2021-08-17 10:10:41 +02:00
2024-11-19 11:32:56 +01:00
2024-12-01 16:50:17 +01:00
2022-09-14 09:50:55 +02:00
2024-11-19 11:32:56 +01:00
2022-11-07 21:33:17 +01:00
2021-08-17 10:10:41 +02:00
2024-12-01 16:50:17 +01:00
2024-07-31 07:31:14 +02:00
2022-03-24 08:36:43 +01:00
2021-08-17 10:10:41 +02:00
2025-02-07 15:40:53 +00:00
2024-07-31 07:31:14 +02:00
2021-08-17 10:10:41 +02:00
2025-02-07 15:40:53 +00:00
2024-01-13 18:58:23 +01:00
2025-02-07 15:40:53 +00:00
2025-02-07 15:40:53 +00:00
2023-06-05 10:19:47 +02:00
2024-11-19 11:32:56 +01:00
2023-03-21 08:07:28 +01:00
2022-09-14 09:50:55 +02:00
2023-12-04 12:48:17 +01:00
2024-12-01 16:50:17 +01:00
2024-08-28 08:31:10 +02:00
2024-11-19 11:32:56 +01:00
2024-12-16 12:04:24 +01:00
2024-12-01 16:50:17 +01:00
2024-11-19 11:32:56 +01:00
2024-11-19 11:32:56 +01:00
2024-11-19 11:32:56 +01:00
2024-09-10 13:36:17 +02:00
2020-06-18 22:32:26 +01:00
2020-06-18 08:15:47 +02:00
2023-08-04 19:57:30 +02:00
2020-06-18 08:15:47 +02:00
2024-11-19 11:32:56 +01:00
2024-09-18 20:31:19 +02:00
2025-04-01 13:41:57 +02:00
2025-04-01 13:41:57 +02:00
2024-09-18 20:31:19 +02:00
2023-09-20 09:04:47 +02:00
2023-08-04 19:57:30 +02:00
2023-12-03 16:01:46 +01:00
2022-09-14 09:50:55 +02:00
2021-08-29 10:47:53 +02:00
2024-08-10 12:58:20 +01:00
2024-12-01 16:50:17 +01:00
2023-07-07 11:00:40 +00:00
2023-07-07 11:00:40 +00:00
2024-11-19 11:32:56 +01:00
2022-07-28 17:32:45 +02:00