groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Divij Vaidya <divijvaidy...@gmail.com>
Subject Thread contention on GroovyClassLoader sourceCache
Date Fri, 23 Feb 2018 22:24:35 GMT
Hello,

My name is Divij and I am working on an application which requires
concurrent script compilation with a high throughput.

I am using version 2.4.12 and currently, I am not able to achieve high
throughput because the threads are waiting at the synchronized code block
at [1].

I propose removing the synchronized block and changing sourceCache to
ConcurrentHashMap (or maybe some other thread safe cache that can provide
weak references).

I would be happy to make this change and send a pull request if you think
it is valid change to make.

Regards,
Divij


[1]
https://github.com/groovy/groovy-core/blob/master/src/main/groovy/lang/GroovyClassLoader.java#L266

Mime
View raw message