RFR JDK-7186258: InetAddress$Cache should replace currentTimeMillis with nanoTime (+more)

Martin Buchholz martinrb at google.com
Thu Jul 3 17:59:51 UTC 2014


On Wed, Jul 2, 2014 at 7:39 AM, Claes Redestad <claes.redestad at oracle.com>
wrote:

> Hi Peter,
>
>  perhaps the synchronized(this)-block in NameServiceAddresses::get() can
> be replaced with a ReentrantLock? Applying this on top of your patch, I
> seem to improve scores on your benchmark for -t 4 by ~33% on my machine:
>

Once upon a time ReentrantLock had some performance advantage over builtin
synchronized; but today best practice is to prefer ReentrantLock only for
the software engineering advantages like more flexibility or clarity.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20140703/22ca386d/attachment.html>


More information about the net-dev mailing list