Skip to main content

BATCH_BYTES

Constant BATCH_BYTES 

Source
pub const BATCH_BYTES: usize = _ /* 8_192usize */;
Expand description

Where a batch stops taking items: once what it holds reaches this many bytes, so a batch of large items stays small. A queue’s 1,024 frames are bounded by frames, not bytes (PERF.115-37), and each item takes its size twice from a block: 64 items of 4 KB to a frame held 280 KB a frame and allocated a 512 KiB block every few frames, 16 KiB still 4,096 B an item in one run of two, and a ticket body’s batch would hold a megabyte. At 8 KiB a full queue of 4 KB items holds about 18 MB, which the call’s 80 spare blocks keep. PERF-17 found a count alone cost a 4 KB stream 27 %, and said a batch should stop at bytes.