7 ms·
How to write slow Rust code – Part 2
- jlledo 5y agoIt's always sad to see someone get burnt by the internet, I wish him, and also those who criticised him, well. On a brighter note, I appreciate the noob-friendly explanations. It made it really easy to follow along. I'm also really curious about how Java achieves better stdout performance. I hope we get to apply the lessons to other environments too! I didn't read all of it, so perhaps there's a clue in @bugaevc's PR[1] mentioned in the article. [1] https://github.com/renatoathaydes/prechelt-phone-number-encoding/pull/1 https://github.com/renatoathaydes/prechelt-phone-number-enco...
- jlledo 5y ago[1] did in fact talk about and link to a Rust discussion PR[2] about the stdout perf issue. Essentially Rust always flushes stdout for every line of output, whereas other languages like Python tend to buffer larger blocks before flushing. [2] https://github.com/rust-lang/rust/issues/60673 https://github.com/rust-lang/rust/issues/60673