Large messages & slow receivers
WebSockets are typically used for small message sending. In some cases you might end up with larger-than-ideal messages being sent, and these cases need to be handled efficiently. Especially if receivers are slow and backpressure is building up.
-
Only reduce backpressure in steps of 1/32th of the backpressure itself. This hinders excessive reallocation/shifting of especially large backpressure and improves drainage performance.
-
Use std::string::erase instead of std::string::substr. This alone is a 3x performance improvement for worst cases.
-
Write directly to backpressure if sending a large message, or if already draining. This improves sending performance of large messages as we avoid extra copying/allocations.
-
Adds ability to benchmark large message echoing with load_test. Use extra argument size_mb. This release is at least 1.5x the peformance when echoing 100mb messages.