Do you need to cork for sending websocket messages? #1028
|
I know that res.cork is recommended for best performance for http responses. Should I wrap every send in a cork? Or is it helpful only for sending multiple messages (multiple sends) at once? |
Answered by
uNetworkingAB
Mar 6, 2024
Replies: 1 comment 1 reply
|
Ideally every send should be wrapped in cork but if you don't, there are a few cases where it auto corks either way. So unless you can't easily fit in the lambda's preallocated capture memory, always cork. But you can also just benchmark your solution to find out. |
1 reply
Answer selected by
chanon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ideally every send should be wrapped in cork but if you don't, there are a few cases where it auto corks either way. So unless you can't easily fit in the lambda's preallocated capture memory, always cork. But you can also just benchmark your solution to find out.