r/rust • • Jul 26 '19

Is this comment about the reference counting performance in Rust accurate?

/r/ProgrammerHumor/comments/b274zp/oof/eirvecs?context=3
50 Upvotes

52 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Jul 26 '19

[deleted] — view deleted comment

6

u/[deleted] Jul 27 '19

There's some nuance here though, while Rust the language doesn't use garbage collection, we do have reference counting as part of the standard library, which is often used to share resources between threads (e.g. Arc<Mutex<_>>).

The thing is though that this is mainly used to initially share a resource between threads. After a thread has acquired it, you don't need to keep incrementing/decrementing the resource as you can now just pass around &mut Mutex<_>, so morewubwub's claims about "the worst type possible" is a bit odd.