Skip to content

This is a quick benchmark for an apple to apple comparison with dora-rs#391

Merged
gbin merged 4 commits into
masterfrom
gbin/cu_dorabench
Jul 10, 2025
Merged

This is a quick benchmark for an apple to apple comparison with dora-rs#391
gbin merged 4 commits into
masterfrom
gbin/cu_dorabench

Conversation

@gbin

@gbin gbin commented Jul 10, 2025

Copy link
Copy Markdown
Collaborator

If you happen to be able to actually run theirs that would be even better.

gbin added 4 commits July 10, 2025 07:44
We had a cascading error when the main thread would panic and drop the
logger.
This at least try to keep the logger in a consistent state.
@gbin gbin requested a review from Copilot July 10, 2025 19:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

A new “cu_dorabench” example is added to provide an apple-to-apple benchmark comparison against dora-rs, along with enhancements to mutex handling in the unified logger.

  • Introduces the cu_dorabench example, including source/sink tasks, runner, log reader, config, and README
  • Updates core/cu29_unifiedlog to replace unwrap() on poisoned mutexes with expect and guarded lock() handling
  • Adds the example to the workspace Cargo.toml and defines a new screaming profile

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/cu_dorabench/src/tasks.rs Implements DoraSource/DoraSink benchmark tasks
examples/cu_dorabench/src/main.rs Sets up and runs the benchmark application
examples/cu_dorabench/src/logreader.rs CLI to export logged messages
examples/cu_dorabench/src/lib.rs Reexports tasks
examples/cu_dorabench/copperconfig.ron Pipeline configuration
examples/cu_dorabench/build.rs Emits LOG_INDEX_DIR env var
examples/cu_dorabench/README.md Usage notes for the benchmark
examples/cu_dorabench/Cargo.toml New example crate and dependencies
core/cu29_unifiedlog/src/lib.rs Switches unwrap() to expect/guarded locks in MmapStream
Cargo.toml Adds examples/cu_dorabench to the workspace and screaming profile
Comments suppressed due to low confidence (1)

examples/cu_dorabench/src/main.rs:33

  • The debug! macro is used without importing it (e.g., use log::debug;), which will cause a compile error or unresolved macro.
            debug!("Application Ended: {}", error)


fn process(&mut self, clock: &RobotClock, new_msg: Self::Output) -> CuResult<()> {
new_msg.metadata.tov = Tov::Time(clock.now());
let buffer = self.pool.acquire().unwrap();

Copilot AI Jul 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using unwrap() on pool.acquire() to prevent panics—return an error via ? or handle the None case gracefully.

Copilot uses AI. Check for mistakes.
fn process(&mut self, clock: &RobotClock, new_msg: Self::Output) -> CuResult<()> {
new_msg.metadata.tov = Tov::Time(clock.now());
let buffer = self.pool.acquire().unwrap();
buffer.lock().unwrap()[42] = 42;

Copilot AI Jul 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hard-coded index 42 is a magic number; consider defining a named constant or documenting its significance to improve readability.

Suggested change
buffer.lock().unwrap()[42] = 42;
buffer.lock().unwrap()[BUFFER_INDEX] = 42;

Copilot uses AI. Check for mistakes.
@gbin gbin merged commit 207de12 into master Jul 10, 2025
6 checks passed
@gbin gbin deleted the gbin/cu_dorabench branch July 10, 2025 20:56
@makeecat makeecat added the enhancement New feature or request label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants