by Mathnerd314 · 4y ago · 0 comments
But Discord also made other changes during the rewrite - changing from hash table to B-tree, data structure layout optimizations, reducing memory copying, etc. And the graphs are with those changes included. So the Discord graphs aren't a pure Rust vs Go comparison. I guess I can agree with rsc that it's "misleading" to cite the graphs during a Rust vs. Go comparison.
But the headings of the Discord post imply the latency change for average response time from milliseconds to microseconds is purely due to increasing the cache size, which was only possible due to eliminating the GC spikes. So it is fair to include that as an issue in a Go 1.10 vs Rust comparison. rsc's opinion seems to be that Go 1.18 will fix the latency issue - I disagree, but the only way to tell is to redo the measurements.
I've never seen a "we switched program $X from language $Y to language $Z" post that reproduced exactly the same program, and I don't think it's reasonable to expect that. This one doesn't seem to have done anything crazy like a completely different algorithm, SIMD intrinsics replacing naive code, etc. (The Game's programs actually are that different, so I don't like that study at all.)
The programs that use SIMD intrinsics are split-out:
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
I'd say Mathnerd314's comment is more correct than your nitpick. Reference counting is arguably a form of GC, but I think most people don't call it GC, and there's a reason the JVM and Go have much more sophisticated GCs. For starters, weak references are often insufficient as a mechanism to handle cycles. And really what Mathnerd314 was getting at is that Rust programs typically don't require a GC where Go ones always do. Pointing to a Rust GC library (and there are some) doesn't change that either; it misses the point.