PlatformLogger: isLoggable performance / waste due to HashMap<Integer, Level> leads to Integer allocations (boxing)
Alan Bateman
Alan.Bateman at oracle.com
Wed Mar 20 12:30:55 UTC 2013
On 19/03/2013 12:19, Laurent Bourgès wrote:
> Dear all,
>
> I run recently netbeans profiler on my swing application (Aspro2:
> http://www.jmmc.fr/aspro) under linux x64 platform and figured out a
> performance and waste issue related to PlatformLogger.
>
> Actually, the JavaLogger implementation uses a Map<Integer, Object>
> levelObjects to store mapping between PlatformLogger's levels (int) and JUL
> Level instances.
>
> However, the isLoggable(int level) method is highly used by awt project and
> other JDK projects and it leads to many Integer allocations as autoboxing
> converts the level as int to an Integer instance used by the Map.get() call.
>
It's good to have identified this issue and I agree with Mandy that it
should be fixed.
Have you read the "How to contribute" page [1]? I don't see you on the
OCA list and just wanted to check.
-Alan
[1] http://openjdk.java.net/contribute/
More information about the core-libs-dev
mailing list