From 7c4fbe251c52e77c2a27b6a9a11796c7db7ebe2d Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 21 Mar 2025 10:19:30 +0000 Subject: [PATCH 1/2] Set the level for zstd best speed to 1 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. --- .../index/codec/zstd/Zstd814StoredFieldsFormat.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java b/server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java index 6aa77b7222696..fcd135658e0e9 100644 --- a/server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java +++ b/server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java @@ -48,7 +48,7 @@ public final class Zstd814StoredFieldsFormat extends Lucene90CompressingStoredFi public static final String MODE_KEY = Zstd814StoredFieldsFormat.class.getSimpleName() + ".mode"; public enum Mode { - BEST_SPEED(0, BEST_SPEED_BLOCK_SIZE, 128), + BEST_SPEED(1, BEST_SPEED_BLOCK_SIZE, 128), BEST_COMPRESSION(3, BEST_COMPRESSION_BLOCK_SIZE, 2048); final int level, blockSizeInBytes, blockDocCount; From 38137c5ae37de1e5f94e18fbaabe153cc5a7c60a Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Fri, 21 Mar 2025 10:47:20 +0000 Subject: [PATCH 2/2] fix test --- .../src/test/java/org/elasticsearch/index/codec/CodecTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/index/codec/CodecTests.java b/server/src/test/java/org/elasticsearch/index/codec/CodecTests.java index 9c9492df24cf3..028d2d8e714de 100644 --- a/server/src/test/java/org/elasticsearch/index/codec/CodecTests.java +++ b/server/src/test/java/org/elasticsearch/index/codec/CodecTests.java @@ -57,7 +57,7 @@ public void testDefault() throws Exception { assumeTrue("Only when zstd_stored_fields feature flag is enabled", CodecService.ZSTD_STORED_FIELDS_FEATURE_FLAG.isEnabled()); Codec codec = createCodecService().codec("default"); assertEquals( - "Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=0), chunkSize=14336, maxDocsPerChunk=128, blockShift=10)", + "Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=1), chunkSize=14336, maxDocsPerChunk=128, blockShift=10)", codec.storedFieldsFormat().toString() ); }