News for hackers. Stuff that matters.
Re:Rust Performance Pitfalls by Animats on Thursday June 08, 2017 @01:46PM (#14515776)
Right. The correct answer here is to convert external data into UTF-8 once and keep it that way. You're probably not going to become compute-bound, even if you're just reading in text and writing it out again. The UTF-8 check is linear time.
Re:Rust Performance Pitfalls by burntsushi on Thursday June 08, 2017 @01:57PM (#14515848)
Most of the Rust programs I write are compute bound, and finding ways to avoid the separate UTF-8 validation step are critical to their performance.
Re:Rust Performance Pitfalls by Animats on Thursday June 08, 2017 @02:14PM (#14515958)
That's because you write string search programs. Do those even need to run in UTF-8 space, as opposed to pure byte strings?
Re:Rust Performance Pitfalls by gpderetta on Thursday June 08, 2017 @04:47PM (#14517076)
If you are reading text and writing it out you generally do not want to convert to utf8 as it is potentially lossy. Think of unix filters.