Skip to content

Commit

Permalink
Enable Fast Double Parser in Jackson
Browse files Browse the repository at this point in the history
Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
  • Loading branch information
mgodwan committed Jun 5, 2023
1 parent e3740f7 commit 802e679
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.StreamReadConstraints;

import com.fasterxml.jackson.core.StreamWriteFeature;
import org.opensearch.core.xcontent.DeprecationHandler;
import org.opensearch.core.xcontent.MediaType;
import org.opensearch.core.xcontent.NamedXContentRegistry;
Expand Down Expand Up @@ -78,6 +78,8 @@ public static XContentBuilder contentBuilder() throws IOException {
jsonFactory.configure(JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT, false);
jsonFactory.configure(JsonParser.Feature.STRICT_DUPLICATE_DETECTION, true);
jsonFactory.setStreamReadConstraints(StreamReadConstraints.builder().maxStringLength(DEFAULT_MAX_STRING_LEN).build());
jsonFactory.configure(JsonParser.Feature.USE_FAST_DOUBLE_PARSER, true);
jsonFactory.configure(StreamWriteFeature.USE_FAST_DOUBLE_WRITER.mappedFeature(), true);
jsonXContent = new JsonXContent();
}

Expand Down

0 comments on commit 802e679

Please sign in to comment.