Skip to content
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

optimize reduce CPU usage for multi-thread decompressor #2

Closed
sisong opened this issue Aug 13, 2024 · 1 comment
Closed

optimize reduce CPU usage for multi-thread decompressor #2

sisong opened this issue Aug 13, 2024 · 1 comment

Comments

@sisong
Copy link
Owner

sisong commented Aug 13, 2024

ref ebiggers#335 (comment) , a speed testing
The multi-thread parallel of pgzip mainly optimizes the compression speed.
and the decompression multi-thread, only handles asynchronous I/O, and it supports up to 3 threads: one for reading the code data, one for decompressing, and one for writing the uncompresssed data.
For the sake of source code simplicity, the waiting between threads is loop+this_thread::yield(), and the formal implementation should use condition variable.

sisong referenced this issue Aug 14, 2024
…d::sleep_for(x); for reduce CPU usage;

try reduce mem when meet large block;
@sisong
Copy link
Owner Author

sisong commented Aug 14, 2024

@ghuls
update for reduce CPU usage when multi-thread decompress.

@sisong sisong closed this as completed Aug 14, 2024
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

No branches or pull requests

1 participant