Repository navigation
Commit 8828b33
committed
Store Tachyon samples in bounded columnar blocks
Tachyon currently stores all samples in a single compressed stream. Replay
has to decompress the complete sample section before it can process any
samples, so temporary memory usage grows with the length of the capture. The
stream also mixes data with different patterns and repeatedly stores values
such as thread and interpreter IDs.
Change the file format to split samples into independently decodable blocks,
each limited to 1 MiB of decoded data. Strings and frames remain shared across
the whole file, preserving deduplication across the complete capture.
Within each block, separate the sample data into columns for stream
identifiers, timestamps, statuses, stack changes, and frame indices. Store
each thread and interpreter pair once and have samples refer to those pairs by
index. Encode timestamps relative to the expected sampling time for each
stream, and store status bits common to all samples in the block once while
packing the bits that vary into bitmaps.
Encode stacks by reusing unchanged stacks, retaining common outer frames when
only part of a stack changes, and referring back to complete stacks already
seen in the block. Store frame indices using the smallest byte width needed by
the block. These encodings remove repeated values and group similar data
together before compression.
Compress each column independently as raw bytes, a repeated byte, or zstd,
whichever is smallest. The block header contains the information needed to
locate, validate, and decode these columns independently.
Replay can then decode one block at a time and reuse its buffers for
subsequent blocks. This bounds temporary sample decompression memory by the
block size rather than the total capture length, although the shared string
and frame tables still grow with the number of unique entries.
This change only applies to profiles exported to files. Live streaming will
need a different approach because it cannot rely on string and frame tables
written at the end of the file, and is left for gh-145464.1 parent 1512f78 commit 8828b33
12 files changed
Lines changed: 2248 additions & 997 deletions
File tree
- InternalDocs
- Lib
- profiling/sampling
- test/test_profiling/test_sampling_profiler
- Misc/NEWS.d/next/Library
- Modules/_remote_debugging
- clinic
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
0 commit comments