Skip to content

feat(bench): support multiple transforms and --all flag#90

Open
oritwoen wants to merge 1 commit intomainfrom
feat/bench-multiple-transforms
Open

feat(bench): support multiple transforms and --all flag#90
oritwoen wants to merge 1 commit intomainfrom
feat/bench-multiple-transforms

Conversation

@oritwoen
Copy link
Copy Markdown
Owner

Closes #83

vuke bench used to take a single --transform. Comparing throughput across transforms meant running the command a dozen times. Now it accepts multiple values and an --all flag:

vuke bench --all
vuke bench --transform sha256 --transform md5 --transform direct

Multiple transforms print a comparison table. --all includes all benchmarkable transforms (everything except bitimage which needs external files). JSON output returns an array when benchmarking multiple transforms.

Single transform behavior is unchanged.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

Warning

Rate limit exceeded

@oritwoen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 26 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 339e566c-82cd-4f7d-aa32-f3a3d129afb7

📥 Commits

Reviewing files that changed from the base of the PR and between e467e13 and 895f3df.

📒 Files selected for processing (2)
  • src/benchmark.rs
  • src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bench-multiple-transforms
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/bench-multiple-transforms

Comment @coderabbitai help to get the list of available commands and usage tips.

@oritwoen oritwoen self-assigned this Mar 22, 2026
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Confidence score: 4/5

  • This PR is likely safe to merge, with only a small CLI behavior gap rather than a crash or data-loss risk (severity 4/10).
  • In src/main.rs, allowing --all and --transform together currently causes --all to silently win, which can confuse users and produce unintended command behavior.
  • Pay close attention to src/main.rs - enforce mutual exclusivity for --all and --transform so invalid combinations fail fast.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/main.rs">

<violation number="1" location="src/main.rs:251">
P2: `--all` and `--transform` can be passed together, and `--all` silently wins. Make them mutually exclusive so invalid combinations fail fast.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant U as User (CLI)
    participant M as Main (main.rs)
    participant B as Benchmark Service (benchmark.rs)
    participant T as Transform Engine

    U->>M: vuke bench [--all] [--transform X] [--json]
    
    Note over M: NEW: Resolve Transform List
    alt --all flag provided
        M->>B: NEW: default_transforms()
        B-->>M: Return List (Sha256, Md5, etc.)
    else Specific transforms provided
        M->>M: Use provided Vec<TransformType>
    else No flags
        M->>M: Default to [Sha256]
    end

    M->>B: CHANGED: run_benchmark(transforms, json)

    loop For each Transform in list
        B->>B: NEW: bench_single(transform)
        B->>T: create()
        T-->>B: transform instance
        
        Note over B: Run 2s warmup + 5s measurement
        B->>B: internal execution & counter update
    end

    alt json == true
        Note over B: NEW: Return JSON array if multiple
        B-->>U: Output JSON string/array
    else transforms.len() == 1
        Note over B: Behavior unchanged for single
        B-->>U: Output single result stats
    else transforms.len() > 1
        Note over B: NEW: Comparison Table
        B-->>U: Output tabular throughput comparison
    end
Loading

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

transform: Vec<TransformType>,

/// Benchmark all transforms
#[arg(long)]
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot Mar 22, 2026

Choose a reason for hiding this comment

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

P2: --all and --transform can be passed together, and --all silently wins. Make them mutually exclusive so invalid combinations fail fast.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/main.rs, line 251:

<comment>`--all` and `--transform` can be passed together, and `--all` silently wins. Make them mutually exclusive so invalid combinations fail fast.</comment>

<file context>
@@ -243,9 +243,13 @@ enum Command {
+        transform: Vec<TransformType>,
+
+        /// Benchmark all transforms
+        #[arg(long)]
+        all: bool,
 
</file context>
Suggested change
#[arg(long)]
#[arg(long, conflicts_with = "transform")]
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support benchmarking multiple transforms at once

1 participant