-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
type: bugA general bugA general bug
Description
Bug Report
Current Behavior
The ObjectMapper is created inside the parse method every time it is called. This is not optimal.
There are multiple places in the code where we create a new mapper, instead of creating it once and reusing it.
Input Code
Input Code
@Override
public JsonValue fromObject(Object object) {
ObjectMapper objectMapper = new ObjectMapper();
try {
JsonNode root = objectMapper.valueToTree(object);
return DelegateJsonValue.wrap(root);
} catch (IllegalArgumentException e) {
throw new RedisJsonException("Failed to process the provided object as JSON", e);
}
}
Expected behavior/code
Reduce the amount of new objects being created when working with JSON.
Environment
- Lettuce version(s): 6.5.0.RELEASE and up
- Redis version: any
Possible Solution
N/A
Additional context
N/A
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug