-
Notifications
You must be signed in to change notification settings - Fork 16
fix(codspeed): always compile instrument-hooks (with stubs) #132
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
base: main
Are you sure you want to change the base?
Conversation
607879e
to
2561d9f
Compare
CodSpeed Instrumentation Performance ReportMerging #132 will not alter performanceComparing Summary
|
CodSpeed WallTime Performance ReportMerging #132 will degrade performances by 50%Comparing Summary
Benchmarks breakdown
|
2561d9f
to
773b742
Compare
773b742
to
8054636
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 refactors the codspeed crate to always compile the instrument-hooks with stub implementations for non-Linux platforms, instead of conditionally excluding them entirely. The main goal is to provide a unified API across all platforms while maintaining platform-specific optimizations.
Key changes:
- Removes conditional compilation guards that excluded instrument-hooks on non-Linux platforms
- Consolidates platform-specific implementations into a single struct with conditional behavior
- Updates error handling to use unsigned integers instead of signed integers
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/codspeed/src/instrument_hooks/mod.rs | Unified InstrumentHooks implementation with platform-specific conditional logic instead of separate modules |
crates/codspeed/instrument-hooks | Updated subproject commit reference |
crates/codspeed/build.rs | Removed Linux-only compilation guard to build on all platforms |
crates/codspeed/Cargo.toml | Made nix dependency Linux-specific using target-specific dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
#[inline(always)] | ||
pub fn set_executed_benchmark(&self, uri: &str) -> Result<(), u8> { | ||
let pid = std::process::id() as i32; | ||
let c_uri = CString::new(uri).map_err(|_| 1u8)?; |
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.
The error mapping |_| 1u8
discards the original CString creation error information. Consider preserving the error details or using a more descriptive error code.
Copilot uses AI. Check for mistakes.
let c_name = CString::new(name).map_err(|_| 1u8)?; | ||
let c_version = CString::new(version).map_err(|_| 1u8)?; |
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.
The error mappings |_| 1u8
discard the original CString creation error information. Consider preserving the error details or using more descriptive error codes.
Copilot uses AI. Check for mistakes.
No description provided.