-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Bug Report
Current Behavior
This follows up on #3370, which got fixed in #3372. While the ObjectMapper is now reused for parsing, a new instance is still created inside DelegateJsonValue#toObject every time it is called.
Input Code
Input Code
@Override
public <T> T toObject(Class<T> type) {
ObjectMapper mapper = new ObjectMapper();
try {
return mapper.treeToValue(node, type);
} catch (IllegalArgumentException | JsonProcessingException e) {
throw new RedisJsonException("Unable to map the provided JsonValue to " + type.getName(), e);
}
}Expected behavior/code
Reduce the amount of new objects being created when working with JSON.
Environment
- Lettuce version(s): 6.8.0.RELEASE and up
- Redis version: any
Possible Solution
Pass the ObjectMapper configured on the DefaultJsonParser to DelegateJsonValue and its subclasses.
Additional context
N/A
Metadata
Metadata
Assignees
Labels
No labels