Skip to content

perf: allocate a mini chain's sectors for a whole write at once - #88

Open
francisdb wants to merge 1 commit into
mdsteele:masterfrom
francisdb:perf/mini-stream-batching
Open

perf: allocate a mini chain's sectors for a whole write at once#88
francisdb wants to merge 1 commit into
mdsteele:masterfrom
francisdb:perf/mini-stream-batching

Conversation

@francisdb

@francisdb francisdb commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Writing a mini stream added one mini sector at a time: a MiniFAT entry write, a second to link it, and a rewrite of the root directory entry for the mini stream's new length, per 64 bytes; the data then went in 64 bytes at a time. A write past the end of a mini chain now allocates all the mini sectors it needs first (extend_mini_chain_by), writes the MiniFAT entries of each run of consecutive ids together, grows the mini stream (and its root entry) once, and writes through as many consecutive mini sectors as share a regular sector in one call. Reads coalesce the same way.

case (criterion) before after
write to disk, 100 x 4 KiB-1 (mini stream) 67.7 ms 1.6 ms
write to memory, 100 x 4 KiB-1 2.2 ms 0.14 ms
write to disk, 1000 x 64 B 40.6 ms 3.6 ms

A write allocates all the mini sectors it needs first, writes their
MiniFAT entries together and grows the mini stream once, then writes
through consecutive mini sectors of a regular sector in one call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant