-
Notifications
You must be signed in to change notification settings - Fork 6
feat: support allocation heavy benchmarks #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support allocation heavy benchmarks #172
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Changes in this PR:
Mutex<Vec<Event>>which added additional locking overhead during each iteration