-
Notifications
You must be signed in to change notification settings - Fork 2
[CPP-30]Backend CPU Usage benchmark. #9
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
Conversation
07c484a
to
1b1668c
Compare
1b1668c
to
55f50d4
Compare
55f50d4
to
a1f1e3f
Compare
@silverjam Took the cake on this PR. Everything looks good to me though! |
console_backend/benches/benches.rs
Outdated
group.measurement_time(time::Duration::from_millis(BENCHMARK_TIME_LIMIT)); | ||
group.sample_size(BENCHMARK_SAMPLE_SIZE); | ||
group.bench_function("RPM_failure", |b| { | ||
b.iter(|| run_process_messages_failure(file_in_name)) |
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.
Same here, I think we can easily refactor this to just use a "if (failure) { blah }"?
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.
Done. It seems you can just add another "bench_function" and they can be contained within the same group.
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.
code quality checks need some ❤️ but otherwise lgtm
56286ae
to
6f4356f
Compare
messages: impl Iterator<Item = sbp::Result<SBP>>, | ||
client_send_clone: mpsc::Sender<Vec<u8>>, | ||
) { | ||
let mut hpoints: Vec<(f64, OrderedFloat<f64>)> = vec![]; |
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.
A type alias type Point = (f64, OrderedFloat<f64>)
might be nice here
let mut hpoints: Vec<(f64, OrderedFloat<f64>)> = vec![]; | ||
let mut vpoints: Vec<(f64, OrderedFloat<f64>)> = vec![]; | ||
let mut sat_headers: Vec<u8> = vec![]; | ||
let mut sats: Vec<Vec<(f64, OrderedFloat<f64>)>> = vec![]; |
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.
sats
could probably be HashMap<u8, Vec<Point>>
NOTE: It seems this benchmark does not ever complete in Windows locally or in github actions. I suspect there is a difference in how Windows and Linux are handling the spawned thread in the benchmark. May need some other rustaceans to point out what I could be doing wrong.
I created a ticket here to address the Windows issue. https://swift-nav.atlassian.net/browse/CPP-67
Also since the benchmarks seem to be longer running I figure theyd be best parallelized with the Build Checks stage then Installers requires both stages to complete.