William, one thing: did you try changing the concurrency level in MapMaker? We are using the default, which is 4, which may explain the lock contention you are seeing. If you haven't, could you try running your performance tests with a higher level?
Per the docs, "a significantly lower value can lead to thread contention"
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/MapMaker.html#concurrencyLevel(int)
So you might want to try something like
public static synchronized PyType fromClass(Class<?> c, boolean hardRef) {
if (class_to_type == null) {
class_to_type = new MapMaker().concurrencyLevel(16).weakKeys().weakValues().makeMap();
addFromClass(PyType.class, null);
}
We might want to make this the default regardless, given that this is a singleton.