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.
More information about the core-libs-dev
mailing list