Suppress all-zero compressibility columns in heap profiles. - #1021
Merged
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_984203365
branch
8 times, most recently
from
September 21, 2026 02:03
85de915 to
79642bd
Compare
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
Bot
force-pushed
the
test_984203365
branch
from
September 21, 2026 02:08
79642bd to
f09b426
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.