-
Notifications
You must be signed in to change notification settings - Fork 20
feat: add support for analysis mode #152
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
Open
not-matthias
wants to merge
8
commits into
main
Choose a base branch
from
cod-1711-codspeed-rust-add-analysis-mode-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+96
−59
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
687784e
chore: add example with allocations
not-matthias 2318d5f
chore: bump instrument-hooks
not-matthias 00d8a77
feat: add support for analysis mode
not-matthias 569b2de
feat(cargo-codspeed): add analysis build mode
not-matthias 010dfdf
chore(ci): add memory profiling
not-matthias 5fe5c1e
chore(ci): switch to OIDC auth
not-matthias 1fe0cb0
wip: disable memory profiling for now
not-matthias e76d7e2
wip: try to not run codspeed/bencher-compat benches
not-matthias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Submodule instrument-hooks
updated
18 files
| +116 −0 | .github/workflows/ci.yml | |
| +3,248 −2,766 | dist/core.c | |
| +36 −0 | includes/compat.h | |
| +1 −0 | includes/core.h | |
| +4 −0 | scripts/release.py | |
| +3 −1 | src/bincode.zig | |
| +0 −17 | src/c.zig | |
| +6 −0 | src/instruments/analysis.zig | |
| +58 −0 | src/instruments/fifo_instrument.zig | |
| +3 −155 | src/instruments/perf.zig | |
| +25 −14 | src/instruments/root.zig | |
| +5 −1 | src/instruments/valgrind.zig | |
| +185 −0 | src/runner_fifo.zig | |
| +20 −0 | src/shared.zig | |
| +52 −20 | src/tests/deserialize_rust/create_serialized.rs | |
| +29 −0 | src/tests/deserialize_rust/rust_deser.zig | |
| +138 −0 | src/tests/deserialize_rust/serialized.zig | |
| +34 −0 | src/utils.zig |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,3 +44,7 @@ harness = false | |
| [[bench]] | ||
| name = "counters" | ||
| harness = false | ||
|
|
||
| [[bench]] | ||
| name = "alloc" | ||
| harness = false | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| use std::{ | ||
| alloc::Layout, | ||
| collections::{HashMap, HashSet}, | ||
| }; | ||
|
|
||
| #[divan::bench] | ||
| fn allocate() { | ||
| println!("Hello, world!"); | ||
|
|
||
| let vec = vec![1, 2, 3]; | ||
| println!("{vec:?}"); | ||
|
|
||
| let mut map = HashMap::new(); | ||
| map.insert("key", "value"); | ||
| println!("{map:?}"); | ||
|
|
||
| let mut set = HashSet::new(); | ||
| set.insert("apple"); | ||
| set.insert("banana"); | ||
| println!("{set:?}"); | ||
|
|
||
| std::thread::sleep(std::time::Duration::from_secs(1)); | ||
|
|
||
| let mut bytes_vec = vec![0u8; 0x100]; | ||
| println!("{:?}", bytes_vec.len()); | ||
|
|
||
| bytes_vec.extend(&vec![0u8; 0x1000]); | ||
|
|
||
| // Alloc 42 bytes of memory per iteration (4200 bytes total) | ||
| for _ in 0..100 { | ||
| let layout = Layout::new::<[u8; 42]>(); | ||
| let memory = unsafe { std::alloc::alloc(layout) }; | ||
| core::hint::black_box(memory); | ||
| unsafe { std::alloc::dealloc(memory, layout) }; | ||
| } | ||
| } | ||
|
|
||
| fn main() { | ||
| divan::main(); | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.