Repository navigation
Conversation
lohmag
requested review from
SakiTakamachi,
bukka and
kamil-tekiela
as code owners
October 25, 2026 21:18
Sjord
reviewed
Oct 26, 2026
Contributor
|
Looks good to me.
I think it would be interesting to get performance information when the connection goes over the internet. Compression would be more benificial on slow links, but I guess it would not make much of a difference as long as the query fits in one packet. |
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.
With
MYSQLI_CLIENT_COMPRESS, mysqlnd runscompress()on every packet it sends, however small. Each call sets up a new deflate stream, and below a few hundred bytes the packet barely shrinks, so the client pays the full setup cost for almost nothing.This sends packets smaller than 512 bytes uncompressed inside the compressed envelope (uncompressed length 0), which the protocol already allows and which mysqlnd already does for packets that do not shrink. libmysqlclient uses the same mechanism with a 50 byte threshold.
Client CPU per query, release build, one pinned core, MySQL 8.0.46 on the same host,
SELECT '<n bytes>'over a compressed connection, median of 5 runs of 50000 queries:The new test sends payloads on both sides of the threshold, including random data that does not compress, and checks that each one comes back intact.