Message9623

Author zyasoft
Recipients amak, wdroste, zyasoft
Date 2015-03-11.21:50:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426110601.19.0.593790580579.issue2230@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-03-11 21:50:01zyasoftsetmessageid: <1426110601.19.0.593790580579.issue2230@psf.upfronthosting.co.za>
2015-03-11 21:50:01zyasoftsetrecipients: + zyasoft, amak, wdroste
2015-03-11 21:50:01zyasoftlinkissue2230 messages
2015-03-11 21:50:00zyasoftcreate