Skip to content

Implement Rust process benchmarks using Criterion#27

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/implement-process-benchmarks-rust
Draft

Implement Rust process benchmarks using Criterion#27
Copilot wants to merge 4 commits intomainfrom
copilot/implement-process-benchmarks-rust

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 11, 2025

Adds Rust benchmarks mirroring the C# benchmarks, following the pattern established in the Go implementation (#25). All benchmarks execute dotnet --help to measure process spawning overhead across different I/O patterns.

Implementation

  • 4 benchmark suites covering process execution patterns:

    • no_redirection: Child inherits parent handles (3 benchmarks)
    • discard: Output discarded via Stdio::null() (3 benchmarks)
    • redirect_to_file: Direct OS-level file redirection vs pipe-through (3 benchmarks)
    • redirect_to_pipe: Line-by-line, concurrent, and bulk reading patterns (4 benchmarks)
  • Uses Criterion.rs for statistical analysis, HTML reports, and baseline comparisons

  • Concurrent I/O handling: Reads stdout/stderr in separate threads to prevent deadlocks when buffers fill

Usage

cd BenchmarksRust
cargo bench                              # Run all benchmarks
cargo bench --bench redirect_to_pipe     # Run specific suite
cargo bench -- pipe                      # Filter by pattern

Reports generated in target/criterion/report/index.html

Documentation

BenchmarksRust/README.md covers:

  • Running benchmarks with best practices (release mode, CPU governor settings)
  • Filtering by pattern, baseline comparisons, profiling integration
  • Output interpretation and troubleshooting
  • Assumes reader unfamiliar with Rust ecosystem
Original prompt

This section details on the original issue you should resolve

<issue_title>Implement Process benchmarks using rust</issue_title>
<issue_description>Study the C# benchmarks we have in https://github.com/adamsitnik/ProcessPlayground/tree/main/Benchmarks, implement their counterparts using the standard libraries in rust.

Add a short document that explains how to run these benchmarks following all the best practices (like run in Release mode etc). Assume the reader is not familiar with rust.

Context: we did the same for golang #25</issue_description>

<agent_instructions>Run dotnet --help process as part of each benchmark</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 11, 2025 17:35
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
…direct_to_pipe_lines

Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement process benchmarks using Rust Implement Rust process benchmarks using Criterion Dec 11, 2025
Copilot AI requested a review from adamsitnik December 11, 2025 17:44
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.

Implement Process benchmarks using rust

2 participants