You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "justinrsweeney (via GitHub)" <gi...@apache.org> on 2023/03/17 14:45:07 UTC

[GitHub] [solr] justinrsweeney commented on a diff in pull request #1469: SOLR-16706: Reduce the ZLibCompressor compression buffer size.

justinrsweeney commented on code in PR #1469:
URL: https://github.com/apache/solr/pull/1469#discussion_r1140330041


##########
solr/core/src/java/org/apache/solr/cloud/overseer/ZkStateWriter.java:
##########
@@ -286,7 +286,8 @@ public ClusterState writePendingUpdates(
           } else {
             byte[] data = Utils.toJSON(singletonMap(c.getName(), c));
             if (minStateByteLenForCompression > -1 && data.length > minStateByteLenForCompression) {
-              data = compressor.compressBytes(data);
+              // When compressing state.json, we expect at least a 10:1 compression ratio.
+              data = compressor.compressBytes(data, data.length / 10);

Review Comment:
   Is this expectation based on a test? 
   
   The intention here was that by doing it as the same length and uncompressed data, we consume a bit more memory initially, but save on having to potentially resize the array. The ZLib docs seem to indicate an expected compression ratio of between 2:1 and 5:1. Would we be better off erring on the side of less compression and save resizing?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org