remem
remem copied to clipboard
Remove lifetime from `ItemGuard`
Since inner object is Arc, lifetime is not needed.
This enables more flexible usage, for example sending an ItemGuard<T> via a channel.
This looks good! Do we know if having to clone the underlying arc on every get has any performance impact? I would assume it's negligible, but might be worth looking into.
Added a benchmark for Pool::get. Each get before my commits costs ~54 ns, after my commits it costs ~66 ns.
With reference:
test remem::get ... bench: 54,504 ns/iter (+/- 764)
With Arc:
test remem::get ... bench: 66,326 ns/iter (+/- 317)