Skip to content

Commit daa10be

Browse files
committed
Enable Fast Double Parser in Jackson
Signed-off-by: Mohit Godwani <[email protected]>
1 parent a72edf8 commit daa10be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import com.fasterxml.jackson.core.JsonGenerator;
3838
import com.fasterxml.jackson.core.JsonParser;
3939
import com.fasterxml.jackson.core.StreamReadConstraints;
40-
40+
import com.fasterxml.jackson.core.StreamWriteFeature;
4141
import org.opensearch.core.xcontent.DeprecationHandler;
4242
import org.opensearch.core.xcontent.MediaType;
4343
import org.opensearch.core.xcontent.NamedXContentRegistry;
@@ -78,6 +78,8 @@ public static XContentBuilder contentBuilder() throws IOException {
7878
jsonFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
7979
jsonFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
8080
jsonFactory.setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(DEFAULT_MAX_STRING_LEN).build());
81+
jsonFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
82+
jsonFactory.configure(StreamWriteFeature.USE_FAST_DOUBLE_WRITER.mappedFeature(), true);
8183
jsonXContent = new JsonXContent();
8284
}
8385

0 commit comments

Comments
 (0)