feat :🏎️ Add benchmarking support with Criterion.rs and example benchmarks
documentationenhancement
<!--
Thank you 🙏 for your contribution to [Ultralytics](https://www.ultralytics.com/) 🚀! Your effort in enhancing our repositories is greatly appreciated. To streamline the process and assist us in integrating your Pull Request (PR) effectively, please follow these steps:
1. Check for Existing Contributions: Before submitting, kindly explore existing PRs to ensure your contribution is unique and complementary.
2. Link Related Issues: If your PR addresses an open issue, please link it in your submission. This helps us better understand the context and impact of your contribution.
3. Elaborate Your Changes: Clearly articulate the purpose of your PR. Whether it's a bug fix or a new feature, a detailed description aids in a smoother integration process.
4. Ultralytics Contributor License Agreement (CLA): To uphold the quality and integrity of our project, we require all contributors to sign the CLA. Please confirm your agreement by commenting below:
I have read the CLA Document and I sign the CLA
For more detailed guidance and best practices on contributing, refer to our ✅ [Contributing Guide](https://docs.ultralytics.com/help/contributing/). Your adherence to these guidelines ensures a faster and more effective review process.
-->
## 🛠️ PR Summary
<sub>Made with ❤️ by [Ultralytics Actions](https://www.ultralytics.com/actions)</sub>
### 🌟 Summary
Adds Criterion.rs-based benchmarking support with an example benchmark and documentation to help measure and track performance in `ultralytics/template-rust` 🏎️
### 📊 Key Changes
- ➕ Adds `criterion` as a dev-dependency with HTML report support and registers an `example_bench` target in `Cargo.toml`.
- 📁 Introduces a `benches/` directory containing `example_bench.rs` that benchmarks `add_numbers` using Criterion.rs.
- 📚 Adds `benches/README.md` documenting how to run, extend, and interpret benchmarks, including best practices.
- 🧹 Updates `.gitignore` to exclude Criterion benchmark output (`/target/criterion/`) and Cargo Deny cache (`.cargo-deny/`).
### 🎯 Purpose & Impact
- 🚀 Provides a ready-to-use benchmarking setup so contributors can measure performance impact of their changes.
- 📈 Enables consistent performance tracking over time via Criterion.rs reports and comparisons across runs.
- 🤝 Encourages performance-aware development by documenting patterns for adding new benchmarks and following best practices.
合并状态:未合并 1 条评论