bineanzhou / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Objects.assertNoNulls performs a JVM-wide lock #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The following line:

if (("I'm a bad hack".equals(
   System.getProperty("guice.allow.nulls.bad.bad.bad")))) {

performs a System.getProperty invocation, which in turn invokes get() on
its static field props. The get() method is synchronized and thus
effectively forms a lock, exclusive on the entire JVM. This negatively
affects multi-thread injection performance as it is invoked transitively
from InjectorImpl.getInstance().
This behaviour was observed on WebSphere on IBM Java 5 but is probably
present in SUN's java as well.

Original issue reported on code.google.com by martin.v...@gmail.com on 23 Jul 2008 at 2:29

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 23 Jul 2008 at 4:09

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by limpbizkit on 10 Aug 2008 at 5:02