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? |
Beta Was this translation helpful? Give feedback.
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. |
Beta Was this translation helpful? Give feedback.
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.