FilePermission Canonical path optimization
youdwei at linux.vnet.ibm.com
Fri Dec 5 02:39:22 UTC 2014
The original init() methods invoked by FilePermission constructors and
readObject() for deserialization. The constructors will be invoked only
once for each FilePermission Object and the ObjectInputStream will create
new FilePermission for each deserialization so the old init() is fine
without synchronization. This patch however requires there is only one
thread invokes the get_dir_rec() method to construct the cpath so it's true
this method need syncrhonization. I will update the patch later accordingly.
Thanks a lot!
2014-12-01 16:36 GMT+08:00 Wang Weijun <weijun.wang at oracle.com>:
> Do you need some kind of synchronization on the get_dir_rec() method?
> > On Dec 1, 2014, at 16:06, deven you <youdwei at linux.vnet.ibm.com> wrote:
> > Hi All,
> > File.getCanonicalPath() is a very time-consuming method, we observed
> > significant performance degradation from some application's startup stage
> > with java.io.FilePermission. However, lazying load the calls to
> > getCanonicalPath() from java.ioFilePermission is straightforward and
> > this problem effectively. Openjdk bug tracks this bug and here is the
> > patch . Could anyone take a look?
> >  https://bugs.openjdk.java.net/browse/JDK-8066211
> >  http://cr.openjdk.java.net/~youdwei/ojdk-912/webrev.00/
More information about the core-libs-dev