feat: support allocation heavy benchmarks#172
Merged
not-matthias merged 4 commits intomainfrom Dec 18, 2025
Merged
Conversation
This lead to slowdowns of 10+ minutes in CI when dealing with millions of memtrack events.
af1f5e9 to
936bb32
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for allocation-heavy benchmarks by optimizing memory usage during event collection and serialization. The changes enable handling large volumes of memory allocation events without causing excessive memory consumption.
Key Changes:
- Modified the Memory executor to use size-based compression logic (matching WallTime behavior) instead of always using in-memory compressed archives
- Introduced streaming serialization for MemtrackArtifact to avoid loading all events into memory at once
- Simplified event handling by removing unnecessary Arc/Mutex wrappers and directly returning events from the processing thread
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/run/uploader/upload.rs | Moved Memory executor from Valgrind's always-compress logic to WallTime's size-based compression decision |
| crates/runner-shared/src/artifacts/mod.rs | Added encode_to_writer trait method with default implementation for streaming serialization |
| crates/runner-shared/src/artifacts/memtrack.rs | Implemented custom encode_to_writer and decode_streamed for streaming event serialization/deserialization |
| crates/memtrack/src/main.rs | Refactored event collection to return Vec directly from thread instead of using Arc<Mutex> |
Comments suppressed due to low confidence (1)
crates/runner-shared/src/artifacts/memtrack.rs:33
- The
encode_to_writermethod override forMemtrackArtifactis not explicitly tested for error conditions. While the happy path is tested intest_decode_streamed, consider adding test coverage for scenarios where serialization might fail, such as write errors or invalid event data, to ensure proper error propagation.
impl MemtrackArtifact {
pub fn decode_streamed<R: std::io::Read>(reader: R) -> anyhow::Result<MemtrackEventStream<R>> {
Ok(MemtrackEventStream {
deserializer: rmp_serde::Deserializer::new(reader),
})
}
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
pub struct MemtrackEvent {
pub pid: pid_t,
pub tid: pid_t,
pub timestamp: u64,
pub addr: u64,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
936bb32 to
12452f0
Compare
adriencaccia
approved these changes
Dec 18, 2025
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.
Changes in this PR:
Mutex<Vec<Event>>which added additional locking overhead during each iteration