RcLite: Arc<T> and Rc<T> with up to 100% memory efficiency

313 points fereidani

Hello Rust Community!

I like to introduce you to a small project I created that offers a more efficient reference counting solution. RcLite is a lightweight alternative to Arc<T> and Rc<T> without Weak references. With RcLite, in 64-bit systems, the reference count could be stored in 4 bytes of unused memory padding of the structure, resulting in improved performance and reduced memory usage compared to the 16 bytes used by the standard library. In addition Rc<T> could help to increase the cache hit ratio of your application.

While RcLite may not be suitable for structures requiring more than 4 billion references, it's a good choice for those looking to optimize performance and memory usage.

I would love to hear your feedback on the library, please check it out at https://github.com/fereidani/rclite.

Thank you for taking the time to read this and have a wonderful day!