Avoid creating batch buffers just to determine whether a batch should be globally compressed

Instead, sum together the lengths of encoded packet buffers and use that to decide whether to build the buffer or not.
This commit is contained in:
Dylan K. Taylor
2023-02-22 22:43:10 +00:00
parent 6a64486f55
commit 8234360c8d
4 changed files with 73 additions and 17 deletions

View File

@ -891,6 +891,9 @@ class Server{
if($this->configGroup->getPropertyInt("network.batch-threshold", 256) >= 0){
$netCompressionThreshold = $this->configGroup->getPropertyInt("network.batch-threshold", 256);
}
if($netCompressionThreshold < 0){
$netCompressionThreshold = null;
}
$netCompressionLevel = $this->configGroup->getPropertyInt("network.compression-level", 6);
if($netCompressionLevel < 1 || $netCompressionLevel > 9){