Open and answer this issue on GitHub.
bug, ready · opened 2026-11-28 · updated 2026-11-28 · 0 comments
Found while “io::lines() reads into a fixed pool and yields views” (#2851), builder’s step 4 report, at 471b3124.
for line in io::lines() { n += 1; total += line.len() } over 100 000 lines (3 685 944 bytes) on standard input, counted with mem::allocations() on the main thread:
io-method = "blocking": 9 allocations for the whole loop (the pool’s start-up) and none per refill.The pool allocates nothing per chunk: the bytes are reused through Arc::get_mut, the keep slot is inline and the reply channel is kept for the loop. So the allocation is in the executor’s wait for the I/O worker’s answer.
ADR-stream-buffers-v1 D1 (a fixed pool, no allocation in steady state) and D9. The figure in the ADR index assumes no allocation per refill.
Unknown. Suspected in crates/nikaia-std/src/rt/exec.rs, in block_on’s park under io_uring (a waker or a future boxed per wait). Settle it by counting mem::allocations() around one time::sleep(1.millis()) under the default io-method, or with callgrind once valgrind can run such a program (docs/measuring.md: it hangs on stdin there).
tests/compiler/tests/a_wait_on_the_io_worker_allocates_nothing.nika, .stdout, which prints the allocations counted around 100 waits as 0.The test passes, and the #2851 loop under the default io-method allocates no more than under blocking (9 for 100 000 lines). The commit carries Fixes #N and the figures.
crates/nikaia-std/src/rt/exec.rs and the runtime Rust around it (platform layer, ADR-platform-layer-v1). List the Rust for #557 / #125.
Facts: Measuring