-
Notifications
You must be signed in to change notification settings - Fork 1k
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
utils.BytesBufferGet performance #681
Comments
by git blame you can find this PR #466. Can you upload the pprof file, or provide a picture of whole flame graph? |
the moment we do pprof, we just catching the binlog position to latest and no handler for it. |
However, i could not understand why using select-case-default in this case will result in high runtime.Lock. still looking at the code (and learning golang as well) |
Is there any special reason for collecting buffers into channels with magical length of 10? Also every 11th+ concurrent call to https://gist.github.com/moredure/4e6b7a1dcd7e0f2d857ca605caf53833 ByteSliceGet will make an allocation, so in highly concurrent environments with high number of requests (more than 10 concurrent requests) ByteSliceGet will allocate, due to sync.Pool interface{} allocates in case of []byte, so some bytebuffer implementation be better used. |
@atercattus ptal, now two persons are planning to revert your pr 😄 |
Hello for all!
In our use case (~1kk fast requests per CPU core) it was enough: this allowed us to save buffers between GCs. Nevertheless. |
@howmoxuan , we merged a few changes, can you check performance from master branch? |
in utils.BytesBufferGet, the code use bytesBufferChan. May I know what is the usage/improvement of that channel based on?
In my application, it consume much CPU resource. (the pprof of the application is attached below). Can we just remove it? I do a benchmark, without channel is much faster. Any reason we add that channel?
The text was updated successfully, but these errors were encountered: