Tub 🛁
A blazingly fast object pool for Rust.
Values are retrieved from the pool asynchronously. When the retrieved value goes out of scope, the value is returned to the pool.
Documentation
Read about the public API: docs.rs/tub
Read about the design: wcygan.io/post/pools
Usage
To use Tub, add this to your Cargo.toml:
[]
= "0.3.7"
Then create and use a pool like so:
use Pool;
async
Benchmarks
In the "Pools" blog post I benchmarked Tub against other object pools in Rust.
The benchmarks help us understand how efficient the underlying mechanisms for concurrency control, object storage, and object reuse are.
The results are as follows:
Input-based comparison
The following benchmarks compare the performance of different pools under different amounts of load:
100,000 acquires & releases
The following benchmarks compare the performance of running 100,000 acquire & release operations across tasks.