Skip to content

perf(runner-shared): buffer the decompressed memtrack event stream - #560

Merged
not-matthias merged 1 commit into
mainfrom
perf-buffer-memtrack-decode
Oct 2, 2026
Merged

not-matthias merged 1 commit into
mainfrom
perf-buffer-memtrack-decode

Conversation

@not-matthias

Copy link
Copy Markdown
Member

Buffer the decompressed stream in MemtrackArtifact::decode_streamed.

rmp_serde reads 1 to 8 bytes per call. Without a buffer, each of those reads goes through zstd's stream API. A BufReader now sits between the zstd decoder and rmp_serde.

On a large memtrack artifact, decoding all events drops from 21-33 s to 11-21 s. Peak memory is unchanged.

Refs COD-3704

`MemtrackArtifact::decode_streamed` handed the zstd decoder straight to
rmp_serde, which reads 1 to 8 bytes per call, so every small read went
through zstd's stream API. Put a `BufReader` between the two.

On a large memtrack artifact, decoding all events drops from 21-33 s to
11-21 s, with no change in peak memory.

Refs COD-3704
@not-matthias
not-matthias marked this pull request as ready for review October 1, 2026 15:26
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds buffering to memory tracking event deserialization.

The PR appears safe to merge.

Summary

The PR adds a buffer between the zstd decoder and the MessagePack deserializer to reduce small reads through the decoder. No actionable issues were identified.

Reviews (1) · Last reviewed commit: "perf(runner-shared): buffer the decompre..."

@codspeed

codspeed Bot commented Oct 1, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 31 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing perf-buffer-memtrack-decode (1cf4bcc) with main (407b28e)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@not-matthias
not-matthias merged commit 1cf4bcc into main Oct 2, 2026
56 checks passed
@not-matthias
not-matthias deleted the perf-buffer-memtrack-decode branch October 2, 2026 07:51
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.

2 participants