zeropool 0.4.1

High-performance buffer pool with constant-time allocation, thread-safe operations, and 5x speedup over bytes crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Single-threaded get/put hot-path profiling target for callgrind.

use std::hint::black_box;
use zeropool::BufferPool;

fn main() {
    let pool = BufferPool::new().min_buffer_size(0);
    // Warm up TLS
    let buf = pool.get(4096);
    drop(buf);

    // Hot loop - single thread get/put (reduced for callgrind)
    for _ in 0..1_000_000 {
        let buf = pool.get(black_box(4096));
        drop(black_box(buf));
    }
}