3 ms·
When it comes to the overhead issues of unique_ptr, I always think of this video here: https://youtu.be/rHIkrotSwcc?t=1192 https://youtu.be/rHIkrotSwcc?t=1192
by TwentyPosts 3y ago
When it comes to the overhead issues of unique_ptr, I always think of this video here:
https://youtu.be/rHIkrotSwcc?t=1192 https://youtu.be/rHIkrotSwcc?t=1192
At 26:50 he gets into how this relates to ABI, and how 'fixing' some of this would require a pretty severe ABI change, as well as destructive move semantics, which would require a severe change to how C++ works.
I frankly don't understand C++ well enough to fully judge about all of this, but everything he says seems entirely solid, and showcases how unique_ptr is in fact not zero-cost, and can in fact be a significant performance trade-off when you really need that extra bit of performance.
> Rust occasionally forces my hand considerably harder (e.g. RC<RefCell<..>> vs std::shared_ptr<>)) in the direction of performance compromise.
How so? Is RC<RefCell<T>> more expensive than std::shared_ptr<T>?
- deleted 3y ago[deleted]