4 ms·
To clarify my question, can Rust read files and split their strings without checking UTF8 correctness? That could speedup the algorithm. In Go I have used this
by hu3 6y ago
To clarify my question, can Rust read files and split their strings without checking UTF8 correctness? That could speedup the algorithm.
In Go I have used this [1] in the past when I had to validate UTF8 encoding but on hot paths where I'm sure UTF8 is valid (coming from sanitized database data for example) I skipped that part.
[1] https://golang.org/pkg/unicode/utf8/#Valid https://golang.org/pkg/unicode/utf8/#Valid
- unionpivo 6y agoyes, you can operate on raw byte strings (you write them like b'this is ASCI' ), and then it would look like go or c code.
- burntsushi 6y ago> To clarify my question, can Rust read files and split their strings without checking UTF8 correctness? That could speedup the algorithm. That's what every single Rust program in this benchmark does, except for the simple variant.