github uNetworking/uWebSockets v19.8.0

latest releases: v20.67.0, v20.66.0, v20.65.0...
3 years ago

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.

Don't miss a new uWebSockets release

NewReleases is sending notifications on new releases.