Skip to content

Fix Lzbench empty metrics on ARM64 due to stdout buffering#664

Open
AlexW-F wants to merge 1 commit intomainfrom
users/alexwill/lzbenchfix
Open

Fix Lzbench empty metrics on ARM64 due to stdout buffering#664
AlexW-F wants to merge 1 commit intomainfrom
users/alexwill/lzbenchfix

Conversation

@AlexW-F
Copy link
Copy Markdown
Contributor

@AlexW-F AlexW-F commented Mar 27, 2026

When lzbench runs with -o4 (CSV format) and stdout is redirected to a file, the C library uses full-buffering (4-8KB blocks). If the process is killed before completion (e.g., by VC timeout), the unflushed buffer is lost and results-summary.csv is empty — especially on ARM64 where lzbench runs slower and never reaches the flush threshold.

Adding stdbuf -oL forces line-buffered output so each CSV row is flushed to disk immediately, ensuring partial results survive process termination.

When lzbench runs with -o4 (CSV format) and stdout is redirected to a file,
the C library uses full-buffering (4-8KB blocks). If the process is killed
before completion (e.g., by VC timeout), the unflushed buffer is lost and
results-summary.csv is empty — especially on ARM64 where lzbench runs
slower and never reaches the flush threshold.

Adding stdbuf -oL forces line-buffered output so each CSV row is flushed
to disk immediately, ensuring partial results survive process termination.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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