-
Notifications
You must be signed in to change notification settings - Fork 380
feat(storer): use buf chan to improve perfomance #5170
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
Conversation
This reverts commit a57b211.
|
|
||
| chunkC := make(chan *reserve.ChunkBinItem) | ||
| workers := max(4, runtime.NumCPU()) | ||
| chunkC := make(chan *reserve.ChunkBinItem, 3*workers) |
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.
the value 3 and then 3*workers were chosen after some testing and benchmarking? How did you choose to use these?
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.
The main reason is to prevent workers from waiting for tasks. It decouples the producer (finding chunks) from the consumers (the workers), allowing it to queue up just enough work to ensure the workers are always busy. I will try to repeat the tests with greater values to double check. But this seems good enough for current logic.

Checklist
Description
Improves making sample time for redistribution game from 15-30% on bee-light-testnet.
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):