r/rust • u/TheProgrammar89 • Jul 26 '19
Is this comment about the reference counting performance in Rust accurate?
/r/ProgrammerHumor/comments/b274zp/oof/eirvecs?context=3
49
Upvotes
r/rust • u/TheProgrammar89 • Jul 26 '19
View all comments
Show parent comment
17
u/Manishearth servo · rust · clippy Jul 26 '19
No in both cases. unique_ptr is like Box, not Rc, so no comparison can be made.
shared_ptr is like Arc, however due to how C++ copy/move construction works you typically end up addref/releasing the shared_ptr a lot more. In most cases this doesn't affect much, but it can.