Skip to main content

Keep the performance. Share the types.

Reservoir is a high-performance object-pooling toolkit for .NET. Warm ObjectPool<T,TPolicy> operations allocate 0 B, shared retention is bounded, and the conventional runtime package works cleanly across application and library boundaries. Legacy collection fallbacks may trim or replace backing storage.

The package provides:

  • One public type identity. Libraries can expose Reservoir types without embedding distinct copies.
  • Normal dependency flow. NuGet resolves Reservoir transitively through PackageReference graphs.
  • Cross-assembly optimization. The JIT can inline hot methods and specialize concrete struct policies.
  • Explicit retention bounds. Every pool has a maximum retained-object count that applies to manual and scoped rentals alike.

Reservoir includes the general-purpose ObjectPool<T,TPolicy>, a convenient policy/factory overload, collection and StringBuilder pools, scoped leases, and a CancellationTokenSource pool.

Requirements​

  • .NET Standard 2.0-compatible runtime or later

Choose a starting point​

NeedStart with
Reuse your own reference typeObjectPool<T,TPolicy>
Prefer a factory or policy objectObjectPool<T>
Reuse a common collectionCollection pools
Reuse StringBuilderStringBuilderPool
Reuse uncanceled timeout sourcesCancellationTokenSourcePool

Continue with installation, then complete the quick start.