Improve test suite by disabling Nagle's algorithm on test sockets - #81
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Autobahn-based test runners by disabling Nagle’s algorithm (enabling TCP_NODELAY) on the ReactPHP sockets used by the client and server test harnesses, aiming to reduce latency and speed up CI execution—especially on PHP 7.4.
Changes:
- Configure the Autobahn echo server socket to use
tcp_nodelay. - Configure the Autobahn client connector sockets to use
tcp_nodelay.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/ab/startServer.php | Adds TCP_NODELAY to the React socket server used by the Autobahn server runner. |
| tests/ab/clientRunner.php | Adds TCP_NODELAY to the React socket connector used by the Autobahn client runner. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset improves the test suite by disabling Nagle's algorithm on the sockets used by the Autobahn test runners. Its compression test cases send a thousand messages each, and on PHP 7.4 every message larger than 8 KiB adds around 40 ms. This looks like the final segment being held back until the peer acknowledges the previous data, although this has not been confirmed at the packet level. Newer PHP versions are unaffected.
On CI this brings the PHP 7.4 job in line with the others and changes the slowest job from around 31 min to around 15 min. All 517 Autobahn test cases still run on every supported PHP version in both client and server mode and report the same results as before.
Refs #59 and #62