RFR [9] 8040837: Avoid provoking NFEs when initializing InetAddrCachePolicy

Claes Redestad claes.redestad at oracle.com
Thu Apr 17 15:56:10 UTC 2014


Hi,

  could I get a review of the following small patch to address 8040837:

  http://cr.openjdk.java.net/~lagergren/8040837/
  https://bugs.openjdk.java.net/browse/JDK-8040837

  A simple JMH microbenchmark shows this actually might have a small 
benefit to startup:

     @GenerateMicroBenchmark
     public int loadInetAddressCachePolicy() throws 
ClassNotFoundException, NoSuchMethodException, 
InvocationTargetException, IllegalAccessException {
         return 
(Integer)Class.forName("sun.net.InetAddressCachePolicy").getMethod("get").invoke(null);
     }

  java -jar microbenchmarks -bm ss -f 100

  before: 0.662 +- 0.086 ms
  after:  0.616 +- 0.084 ms

/Claes


More information about the net-dev mailing list