3 ms·
This is not so much the case in rust because you only increment the reference count when you're passing around copied refs to an item. If you instead borrow a
by AlisdairO 12y ago
This is not so much the case in rust because you only increment the reference count when you're passing around copied refs to an item. If you instead borrow a ref counted item, you don't need to increase the ref count - because rust will statically enforce that the borrow lasts less time than the item it borrows from (which is enough to keep the item alive). With good coding practices, you can eliminate the large majority of ref count increments/decrements.