PlatformLogger: isLoggable performance / waste due to HashMap<Integer, Level> leads to Integer allocations (boxing)

Alan Bateman Alan.Bateman at
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:
> 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.



More information about the core-libs-dev mailing list