TakahikoKawasaki / nv-websocket-client

High-quality WebSocket client implementation in Java.
Apache License 2.0
2.03k stars 292 forks source link

Improve write performance #217

Closed nosnilmot closed 3 years ago

nosnilmot commented 3 years ago
  1. Switch to BufferedOutputStream
  2. Optimize writes for payload length
  3. Mask complete payload before writing, instead of writing 1 byte at a time

PR #128 proposed the first change, but that alone does not provide much performance improvement. Combined, however, these changes increase write throughput from ~440 Mbps to ~2.9 Gbps in my tests. See also issue #124 which this would address.

TakahikoKawasaki commented 3 years ago

@nosnilmot Thank you for your PRs and I'm very sorry for not responding. Which PRs are needed to be merged? This PR (#217) and ...?

nosnilmot commented 3 years ago

Just this PR needs to be merged, PR 128 can then be closed as it is superseded by this one.

TakahikoKawasaki commented 3 years ago

@nosnilmot Thank you very much. This PR has been merged. I'm trying to release nv-websocket-client 2.11 but encountering this issue -> https://issues.sonatype.org/browse/OSSRH-51097

TakahikoKawasaki commented 3 years ago

The sonatype status page ( https://status.maven.org/ ) is saying that it is investigating the issue (Jan 22, 09:33 EST).

TakahikoKawasaki commented 3 years ago

@nosnilmot Sonatype has recovered. nv-websocket-client 2.11 have been released successfully. Thank you very much for your contribution!

nosnilmot commented 3 years ago

Thanks! I think you can close Issue #124 and PR #128 now :)