Skip to content

Suppress all-zero compressibility columns in heap profiles. - #1021

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_984203365
Sep 21, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_984203365

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Suppress all-zero compressibility columns in heap profiles.

MakeProfileProto advertises the space_compressed and zero_space sample types
whenever compressibility collection is enabled, even when not a single sample
was analyzed. Every sample then carries a literal 0 for both, which is
indistinguishable downstream from a heap that was measured and found to hold
no compressible or zero bytes. A consumer computing savings as
(resident + swapped) - compressed scores such a profile as 100% compressible.

Root Cause: the decision to emit the columns was derived from
FLAGS_heapz_collect_compressibility alone, which says the analyzer is allowed
to run, not that it ever produced a result. Analysis is skipped whenever
residency reports nothing for the span, span_start_address is null,
requested_size is 0, or CompressionAnalyzer::Analyze fails, and
SampleMergedData::compressed_size and ::zero_size then keep their zero
initializers.

Have the merge report whether the analyzer ever succeeded and add the two
sample types only when it did. A profile with no measurements now looks
exactly like one from a binary that does not collect compressibility at all:
the columns are absent rather than uniformly zero.

@copybara-service
copybara-service Bot force-pushed the test_984203365 branch 8 times, most recently from 85de915 to 79642bd Compare September 21, 2026 02:03
MakeProfileProto advertises the space_compressed and zero_space sample types
whenever compressibility collection is enabled, even when not a single sample
was analyzed. Every sample then carries a literal 0 for both, which is
indistinguishable downstream from a heap that was measured and found to hold
no compressible or zero bytes. A consumer computing savings as
(resident + swapped) - compressed scores such a profile as 100% compressible.

Root Cause: the decision to emit the columns was derived from
FLAGS_heapz_collect_compressibility alone, which says the analyzer is allowed
to run, not that it ever produced a result. Analysis is skipped whenever
residency reports nothing for the span, span_start_address is null,
requested_size is 0, or CompressionAnalyzer::Analyze fails, and
SampleMergedData::compressed_size and ::zero_size then keep their zero
initializers.

Have the merge report whether the analyzer ever succeeded and add the two
sample types only when it did. A profile with no measurements now looks
exactly like one from a binary that does not collect compressibility at all:
the columns are absent rather than uniformly zero.

PiperOrigin-RevId: 984957126
@copybara-service
copybara-service Bot merged commit f09b426 into master Sep 21, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_984203365 branch September 21, 2026 02:08

This branch was successfully deployed

1 active deployment
github-pages — f09b426f Deployed Sep 21, 2026 by github-pages[bot] via deploy #2745
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