Skip to content

Conversation

@denghongcai
Copy link

This change introduces a new --threads command-line option to allow users to manually specify the number of threads used for decompression. This is particularly useful in scenarios with high disk I/O latency but high bandwidth, where fine-tuning the thread count can improve performance.

To maintain backward compatibility, the existing --single-threaded flag is preserved and is made mutually exclusive with the new --threads option.

  • Added --threads argument to UnzipArgs in src/main.rs.

  • Used clap's conflicts_with attribute to ensure --single-threaded and --threads cannot be used together.

  • Initialized Rayon's global thread pool with the specified number of threads.

  • Updated the logic to treat --threads 1 as equivalent to --single-threaded.

  • Tests pass

  • Appropriate changes to README are included in PR

This change introduces a new `--threads` command-line option to allow users to manually specify the number of threads used for decompression. This is particularly useful in scenarios with high disk I/O latency but high bandwidth, where fine-tuning the thread count can improve performance.

To maintain backward compatibility, the existing `--single-threaded` flag is preserved and is made mutually exclusive with the new `--threads` option.

- Added `--threads` argument to `UnzipArgs` in `src/main.rs`.
- Used `clap`'s `conflicts_with` attribute to ensure `--single-threaded` and `--threads` cannot be used together.
- Initialized Rayon's global thread pool with the specified number of threads.
- Updated the logic to treat `--threads 1` as equivalent to `--single-threaded`.
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.

1 participant