-
Notifications
You must be signed in to change notification settings - Fork 99
refactor: parallel chunk sizing - allow forcing of cpu based chunking #3138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: parallel chunk sizing - allow forcing of cpu based chunking #3138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors parallel chunk sizing logic in the stats and frequency commands to allow forcing CPU-based chunking via the environment variables QSV_STATS_CHUNK_MEMORY_MB and QSV_FREQ_CHUNK_MEMORY_MB. The refactoring introduces support for setting these variables to -1 to force CPU-based chunking (chunk size = records/number of CPUs) as an alternative to memory-aware chunking.
Key changes:
- Modified environment variable parsing to support
-1value for forcing CPU-based chunking - Refactored chunking logic to consolidate mode determination and logging
- Updated documentation across command help text, dotenv template, and environment variable docs
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/cmd/stats.rs | Refactored chunk size calculation logic to support CPU-based chunking when env var is unset or set to invalid value; improved code structure and logging |
| src/cmd/frequency.rs | Applied similar chunking refactor as stats.rs; removed commented-out code |
| dotenv.template | Added documentation for -1 value to force CPU-based chunking for both STATS and FREQ env vars |
| docs/ENVIRONMENT_VARIABLES.md | Updated descriptions for QSV_STATS_CHUNK_MEMORY_MB and QSV_FREQ_CHUNK_MEMORY_MB to document -1 option |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.