Commit 4c170e1
authored
Unrolled build for #160480
Rollup merge of #160480 - fereidani:to_ascii_upperlowercase, r=joshtriplett
Single-pass ASCII lower/upper case conversion
Current algorithm is cloning whole string/vector once, then rereads and rewrites it in-place once again which is sub-optimal and waste of CPU cycles and cache.
This one creates it in a single-pass while copying the data from the original vector.
In my benchmarks this one is about 1.2x-2x to 10x(KBs long strings) faster.2 files changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
643 | | - | |
644 | | - | |
| 642 | + | |
645 | 643 | | |
646 | 644 | | |
647 | 645 | | |
| |||
660 | 658 | | |
661 | 659 | | |
662 | 660 | | |
663 | | - | |
664 | | - | |
665 | | - | |
| 661 | + | |
666 | 662 | | |
667 | 663 | | |
668 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
848 | | - | |
849 | | - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
850 | 851 | | |
851 | 852 | | |
852 | 853 | | |
| |||
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
879 | | - | |
880 | | - | |
881 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
882 | 884 | | |
883 | 885 | | |
884 | 886 | | |
| |||
0 commit comments