Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerializerCache: remove synchronization when only _sharedMap is accessed with a read call #4459

Open
wants to merge 1 commit into
base: 2.18
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private final synchronized ReadOnlyClassToSerializerMap _makeReadOnlyLookupMap()
/**********************************************************
*/

public synchronized int size() {
public int size() {
return _sharedMap.size();
}

Expand All @@ -107,30 +107,22 @@ public synchronized int size() {
*/
public JsonSerializer<Object> untypedValueSerializer(Class<?> type)
{
synchronized (this) {
return _sharedMap.get(new TypeKey(type, false));
}
return _sharedMap.get(new TypeKey(type, false));
}

public JsonSerializer<Object> untypedValueSerializer(JavaType type)
{
synchronized (this) {
return _sharedMap.get(new TypeKey(type, false));
}
return _sharedMap.get(new TypeKey(type, false));
}

public JsonSerializer<Object> typedValueSerializer(JavaType type)
{
synchronized (this) {
return _sharedMap.get(new TypeKey(type, true));
}
return _sharedMap.get(new TypeKey(type, true));
}

public JsonSerializer<Object> typedValueSerializer(Class<?> cls)
{
synchronized (this) {
return _sharedMap.get(new TypeKey(cls, true));
}
return _sharedMap.get(new TypeKey(cls, true));
}

/*
Expand Down