I am analyzing values separated by tabs:
pub fn parse_tsv(line: &str) -> MyType { for (i, value) in line.split('\t').enumerate() {
perf top contains str.find . When I look in the generated assembly code, there is a lot of work involved in encoding UTF-8 characters in &str .
And this is relatively bad. This takes 99% of the execution time.
But finding \t I can't just look for a single-byte \t in a UTF-8 string.
What am I doing wrong? What makes Rust stdlib wrong?
Or maybe Rust has some kind of string library that can represent strings just byte 'u8'? But with all split() , find() and other methods?
source share