Skip to content

Commit

Permalink
LUCENE-9535: Reduce the size of compressed blocks of stored fields by…
Browse files Browse the repository at this point in the history
… 2x.

In order to see whether this has any effect on nigthly benchmarks.
  • Loading branch information
jpountz committed Sep 23, 2020
1 parent 08dcd24 commit 12664dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
*/
public final class LZ4WithPresetDictCompressionMode extends CompressionMode {

// Shoot for 10 sub blocks
private static final int NUM_SUB_BLOCKS = 10;
// Shoot for 5 sub blocks
private static final int NUM_SUB_BLOCKS = 5;
// And a dictionary whose size is about 16x smaller than sub blocks
private static final int DICT_SIZE_FACTOR = 16;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public StoredFieldsWriter fieldsWriter(Directory directory, SegmentInfo si, IOCo
StoredFieldsFormat impl(Mode mode) {
switch (mode) {
case BEST_SPEED:
return new CompressingStoredFieldsFormat("Lucene87StoredFieldsFastData", BEST_SPEED_MODE, BEST_SPEED_BLOCK_LENGTH, 1024, 10);
return new CompressingStoredFieldsFormat("Lucene87StoredFieldsFastData", BEST_SPEED_MODE, BEST_SPEED_BLOCK_LENGTH, 512, 10);
case BEST_COMPRESSION:
return new CompressingStoredFieldsFormat("Lucene87StoredFieldsHighData", BEST_COMPRESSION_MODE, BEST_COMPRESSION_BLOCK_LENGTH, 4096, 10);
default: throw new AssertionError();
Expand All @@ -157,8 +157,8 @@ StoredFieldsFormat impl(Mode mode) {
/** Compression mode for {@link Mode#BEST_COMPRESSION} */
public static final CompressionMode BEST_COMPRESSION_MODE = new DeflateWithPresetDictCompressionMode();

// Shoot for 10 sub blocks of 60kB each.
private static final int BEST_SPEED_BLOCK_LENGTH = 10 * 60 * 1024;
// Shoot for 5 sub blocks of 60kB each.
private static final int BEST_SPEED_BLOCK_LENGTH = 5 * 60 * 1024;

/** Compression mode for {@link Mode#BEST_SPEED} */
public static final CompressionMode BEST_SPEED_MODE = new LZ4WithPresetDictCompressionMode();
Expand Down

0 comments on commit 12664dd

Please sign in to comment.