mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 09:23:31 +00:00
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.