cat ./notes/batch-pool.md

Batch Pool

Journal under construction

Ordinum uses batching on the write path to group multiple operations together and commit them together as a group rather than individually. The concept of batching should not be unfamiliar to most even outside of system design. The simple concept of processing a group of things rather than one at a time logically makes sense and saves time if we can process/treat the group as though it were a single item.

Batching will be a separate Journal itself due to the approach we decided to take for Ordinum by leveraging Rust's type system to create compile time efficent batches and type state patterns for batch states.

For this Journal, we talk about how we took Batches and created a pooling system to optimise memory usage and decrease allocator churn. Ordinum leverages both a global batch pool and a thread local caching strategy to make re-using batches efficient and fair so that no two threads are competing for resources and more importantly we are not constantly allocating memory and dropping it on the hot path.