DATACMNS-332 - Further performance improvements.

Reverted from ConcurrentHashMap to plain HashMap where concurrency wasn't an issue and profiling showed performance hotspots. Introduced caches for ParameterizedTypeInformation.getComponentType() and the resolved raw type in TypeDiscoverer.
This commit is contained in:
Oliver Gierke
2013-05-23 18:56:55 +02:00
parent 905565cbcc
commit cd2ea03928
5 changed files with 29 additions and 13 deletions

View File

@@ -24,7 +24,6 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import org.junit.Before;
import org.junit.Test;
@@ -108,8 +107,8 @@ public class AbstractAnnotationBasedPropertyUnitTests<P extends AnnotationBasedP
context.getPersistentEntity(InvalidSample.class);
fail("Expected MappingException!");
} catch (MappingException o_O) {
ConcurrentMap<TypeInformation<?>, ?> entities = (ConcurrentMap<TypeInformation<?>, ?>) ReflectionTestUtils
.getField(context, "persistentEntities");
Map<TypeInformation<?>, ?> entities = (Map<TypeInformation<?>, ?>) ReflectionTestUtils.getField(context,
"persistentEntities");
assertThat(entities.containsKey(ClassTypeInformation.from(InvalidSample.class)), is(false));
}
}