Mar 25, 2024
I can only assume that you benchmarked two different ways to copy a string or else the strings were too small or something.
std::string assignment is not cheap.
The normal thing you do in rust is pass around and copy string slices. Super cheap.