-
Notifications
You must be signed in to change notification settings - Fork 130
Update benchmarks in bench-vortex #5227
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
Closed
connortsui20
wants to merge
1
commit into
develop
from
claude/modify-bench-vortex-011CUrsvv6nTLZmk8sxjdP3D
Closed
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,7 +161,23 @@ pub struct TimingMeasurement { | |
| pub name: String, | ||
| pub target: Target, | ||
| pub storage: String, | ||
| pub time: Duration, | ||
| pub runs: Vec<Duration>, | ||
| } | ||
|
|
||
| impl TimingMeasurement { | ||
| pub fn mean_time(&self) -> Duration { | ||
| let len = self.runs.len(); | ||
| if len == 0 { | ||
| vortex_panic!("cannot have no runs"); | ||
| } | ||
|
|
||
| let total_nanos: u128 = self.runs.iter().map(|d| d.as_nanos()).sum(); | ||
| let mean_nanos = total_nanos / len as u128; | ||
| Duration::new( | ||
| u64::try_from(mean_nanos / 1_000_000_000).vortex_unwrap(), | ||
| u32::try_from(mean_nanos % 1_000_000_000).vortex_unwrap(), | ||
| ) | ||
| } | ||
|
Comment on lines
+167
to
+180
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we do median here |
||
| } | ||
|
|
||
| impl ToTable for TimingMeasurement { | ||
|
|
@@ -171,7 +187,7 @@ impl ToTable for TimingMeasurement { | |
| name: self.name.clone(), | ||
| target: self.target, | ||
| unit: Cow::from("μs"), | ||
| value: MeasurementValue::Int(self.time.as_micros()), | ||
| value: MeasurementValue::Int(self.mean_time().as_micros()), | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -182,7 +198,7 @@ impl ToJson for TimingMeasurement { | |
| name: self.name.clone(), | ||
| storage: Some(self.storage.clone()), | ||
| unit: Some(Cow::from("ns")), | ||
| value: MeasurementValue::Int(self.time.as_nanos()), | ||
| value: MeasurementValue::Int(self.mean_time().as_nanos()), | ||
| bytes: None, | ||
| time: None, | ||
| commit_id: Cow::from(GIT_COMMIT_ID.as_str()), | ||
|
|
||
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.
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.
can you explain the use of
black_boxhere?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.
no idea... I'm going to test this locally first and I'll probably rewrite stuff
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.
ok its just because the function above uses it
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.
We want bb in cause the compiler kills the call to routine() which does seem very unlikely