Skip to content

Conversation

@ixand
Copy link

@ixand ixand commented Jul 29, 2025

Summary

This PR optimizes the usage of tokio::Runtime in benchmark files by instantiating it only once and passing it into benchmark functions, instead of creating it for every test case.

Why

  • Reduces overhead of runtime creation
  • Improves consistency and maintainability
  • Cleaner code

Let me know if you'd prefer a different structure!

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 29, 2025

CodSpeed Performance Report

Merging #15 will not alter performance

Comparing ixand:optimize-runtime-in-bench (60696f5) with main (5282e85)

Summary

✅ 17 untouched benchmarks
🆕 6 new benchmarks
⁉️ 6 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
⁉️ organize_by_type[1000] 7 ms N/A N/A
⁉️ organize_by_type[100] 736.4 µs N/A N/A
⁉️ organize_by_type[500] 3.5 ms N/A N/A
⁉️ organize_modes[monthly] 8.6 ms N/A N/A
⁉️ organize_modes[type] 6.6 ms N/A N/A
⁉️ organize_modes[yearly] 7.8 ms N/A N/A
🆕 files[1000] N/A 7 ms N/A
🆕 files[100] N/A 745.4 µs N/A
🆕 files[500] N/A 3.5 ms N/A
🆕 mode[monthly] N/A 8.8 ms N/A
🆕 mode[type] N/A 6.7 ms N/A
🆕 mode[yearly] N/A 7.7 ms N/A

@mikeleppane
Copy link
Owner

Thanks for the contribution! 🙏
Please run cargo format and cargo clippy. You can use just format and just clippy for these. Make sure you have just installed: https://just.systems/man/en/packages.html

@ixand
Copy link
Author

ixand commented Jul 29, 2025 via email

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.

2 participants