24 ms·
Go outperforms rust on all kinds of benchmarks, has a larger community, better documentation, more third party libraries, and significantly better tooling. Wha
by dysfunctor 10y ago
Go outperforms rust on all kinds of benchmarks, has a larger community, better documentation, more third party libraries, and significantly better tooling.
What's the value proposition for using rust over go?
- fbender 10y agoSource? First Google result for "Rust vs Go speed": https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=go https://benchmarksgame.alioth.debian.org/u64q/compare.php?la... Rust seems to perform significantly better on some workloads while Go outperforms it marginally in other ones (except reverse-complement where Go is almost 50% faster than Rust). Edit: As for the other points you make – they are often subjective and I've read the opposite to your statement at least as often.
- steveklabnik 10y agoThe ones where Go outperforms us currently are the ones with heavy SIMD use; explicit SIMD is still unstable in Rust, so you're at the whims of LLVM generating it. We'll get there...
- igouy 10y agoDo those Go programs use explicit SIMD ? http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=rust http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
- steveklabnik 10y agoI assume that they're better about generating it implicitly. That is, it's about why Rust is slow, not about why Go is fast.
- pcwalton 10y agoI don't think Go emits SIMD at all. Their assembler doesn't even support parsing it. I think these are probably just bugs that we need to look at. The benchmarks where we do worse are the string benchmarks; perhaps it's our Unicode correctness that is hurting us, or something like that.
- burntsushi 10y agoIt definitely does: https://github.com/golang/go/blob/b851ded09a300033849b60ab47a468087ce557a1/src/runtime/asm_amd64.s#L1394-L1413 https://github.com/golang/go/blob/b851ded09a300033849b60ab47... I should look into those benchmarks if you think there might be string problems. To be frank, I've never looked too closely at anything except for regex-dna.
- pcwalton 10y agoOh, interesting. I was inferring that from the Go code out there that uses machine code directly: https://github.com/minio/blake2b-simd/blob/master/compressAvx2_amd64.s#L181 https://github.com/minio/blake2b-simd/blob/master/compressAv... I guess it must be a recent addition.
- burntsushi 10y agoI think it was recent, yeah. I also recall there being problems with their assembler not being able to parse various SIMD instructions in the past. I also recall seeing code like in your link too. Hmm, Go 1.7 introduced support[1] for various AVX instructions (plus at least one SSE 4.2 instruction), some of which are used in blake2b-simd. I can't wait to get SIMD on Rust stable. It's going to be exciting. [1] - https://golang.org/doc/go1.7#tools https://golang.org/doc/go1.7#tools
- pcwalton 10y agoOh, by the way, if you want to investigate the string benchmarks, that would be really awesome--I'm curious to know what's going on there :)
- mythz 10y agoWhere are these benchmarks showing Go outperforming Rust? I've only seen the opposite with Rust convincingly out performing Go, it would also have more predictable performance thanks to the lack of a GC. At a language-level Rust has generics, a better Type system and is better suited to functional programming. Seems Systems-level programming, High-performance computing and resource-constrained embedded devices are areas where Rust would shine over Go.
- pcwalton 10y ago> What's the value proposition for using rust over go? Productivity features like generics, a more mature optimization pipeline, freestanding (runtime-less use), highly optimized libraries like serialization frameworks and regular expressions, etc. etc.