3 ms·
> Rust programs consume so much resources that it could > just use a GC I'm not sure where this is coming from. Everyone that I've spoken to about using Rus
by kibwen 11y ago
> Rust programs consume so much resources that it could
> just use a GC
I'm not sure where this is coming from. Everyone that I've spoken to about using Rust in place of managed languages has noted incredible reductions in memory usage. Indeed, this was one of the primary reasons for Dropbox adopting Rust for their core storage engine. Quoting from https://news.ycombinator.com/item?id=11283688 https://news.ycombinator.com/item?id=11283688 :
"The reasons for using rust were many, but memory was one of them. Primarily, for this particular project, the heap size is the issue. One of the games in this project is optimizing how little memory and compute you can use to manage 1GB (or 1PB) of data. We utilize lots of tricks like perfect hash tables, extensive bit-packing, etc. Lots of odd, custom, inline and cache-friendly data structures. We also keeps lots of things on the stack when we can to take pressure off the VM system. We do some lockfree object pooling stuff for big byte vectors, which are common allocations in a block storage system. It's much easier to do these particular kinds of optimizations using C++ or Rust."
And the above paragraph is using Go as a baseline, which itself already tends to use less memory than Java.