Skip to content

perf: read file content directly into the result buffer - #166

Open
benjaminbruun wants to merge 1 commit into
masterfrom
perf/read-file-single-alloc
Open

perf: read file content directly into the result buffer#166
benjaminbruun wants to merge 1 commit into
masterfrom
perf/read-file-single-alloc

Conversation

@benjaminbruun

Copy link
Copy Markdown
Member

ss_storage_read_file in the compact storage backend read every file into a temporary
buffer and then copied it into the returned ss_buf, so each read transiently held two
heap copies of the content. It now reads directly into the result buffer; error paths
still zeroize before freeing. Adds tests/storage_compact, the first host coverage of
the compact read path (whole read, offset window, past-EOF and missing-file cases).

@benjaminbruun

Copy link
Copy Markdown
Member Author

For nrf-softsim

@benjaminbruun
benjaminbruun force-pushed the perf/read-file-single-alloc branch 2 times, most recently from 714c5d8 to ce8c061 Compare August 27, 2026 13:08
@benjaminbruun
benjaminbruun marked this pull request as ready for review August 27, 2026 13:08
@benjaminbruun
benjaminbruun requested a review from a team as a code owner August 27, 2026 13:08
ss_storage_read_file bounced every read through a temporary heap copy;
reading into the ss_buf halves the transient allocation per read. Adds
host coverage for the compact read path, which no test compiled before.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
@benjaminbruun
benjaminbruun enabled auto-merge (squash) September 1, 2026 14:03
@benjaminbruun
benjaminbruun force-pushed the perf/read-file-single-alloc branch from ce8c061 to 5d36eaf Compare September 1, 2026 14:03
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