trace-server: pack SpanEvent to 16 bytes, add a memory report
Peak RSS for a large trace is dominated by span / event structs. Cutting those should be a meaningful RSS win. Measurement: - Store::memory_report(), behind MEMORY_REPORT=1, computes a breakdown of span chunks, events, arg heap spill, etc. - TurboMalloc::memory_usage() is appended to the progress line. Whole-process RSS is too noisy to use here SpanEvent cut in half: - Drop a per-event OnceLock, which was half of the struct. - Removing it left SpanEvent as a hand-packed, two word struct. And the CHILD_TAG bit allows ORD to ensure the previous sort order. - invalidate_outdated_spans no longer walks event lists. That loop ran over every ancestor of every touched span after each read batch, so this is an ingestion speed win as well as a memory one. Measured with STOP_AT=2000: size_of::<SpanEvent>() 32 -> 16 size_of::<Span>() 344 -> 328 events heap 1030 -> 515 MB allocator live 5044 -> 4424 MB (-620 MB) peak RSS 5979 -> ~5200 MB (-13%) ingest rate 236MB/s -> 262 MB/s Tests: Fixture tests so that we can guarantee behavior across changes, with ignore'd tests so that we can manually run them without affecting CI. There are 4 new tests that _do_ run on CI, including a cache coherence one.
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment