Skip to content

Commit 8a867e6

Browse files
committed
Set the level for zstd best speed to 1 (elastic#125375)
This change sets the zstd best speed level from 0 to 1. Compression level 0 means the default level will be used, which is level 3. The intent of speed is to use the fastest compression level so 1 is a more appropriate value. Note that zstd best speed is still under a feature flag so this change is just meant to evaluate the impact on our nightly benchmarks. Further testing is needed (wip) to remove the feature flag entirely.
1 parent ab8b1f0 commit 8a867e6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public final class Zstd814StoredFieldsFormat extends Lucene90CompressingStoredFi
4848
public static final String MODE_KEY = Zstd814StoredFieldsFormat.class.getSimpleName() + ".mode";
4949

5050
public enum Mode {
51-
BEST_SPEED(0, BEST_SPEED_BLOCK_SIZE, 128),
51+
BEST_SPEED(1, BEST_SPEED_BLOCK_SIZE, 128),
5252
BEST_COMPRESSION(3, BEST_COMPRESSION_BLOCK_SIZE, 2048);
5353

5454
final int level, blockSizeInBytes, blockDocCount;

server/src/test/java/org/elasticsearch/index/codec/CodecTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testDefault() throws Exception {
5757
assumeTrue("Only when zstd_stored_fields feature flag is enabled", CodecService.ZSTD_STORED_FIELDS_FEATURE_FLAG.isEnabled());
5858
Codec codec = createCodecService().codec("default");
5959
assertEquals(
60-
"Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=0), chunkSize=14336, maxDocsPerChunk=128, blockShift=10)",
60+
"Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=1), chunkSize=14336, maxDocsPerChunk=128, blockShift=10)",
6161
codec.storedFieldsFormat().toString()
6262
);
6363
}

0 commit comments

Comments
 (0)