Skip to content

Comment on Go vs. Rust: Writing a CLI Toolparent

Comments

For a naive code solution, I found the default naive golang code to be better performing than Rust, when processing multiple files together (I/O-bound). I'd be careful assuming Rust is faster by default, as Go has some pretty sane defaults out of the box. The developer experience is faster, simpler and stabler(?) too, but really depend what you want to make. I find Rust interesting but haven't found the time/project to learn it properly on. Point being to avoid costs and risks of premature optimizations.

Often, slow file reading means that you didn't use a BufReader, and are making more system calls than you need to.

Tip: Rust BufReaders default to 8KiB buffers which are way too small for high-performance sequential NVME I/O.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.