Index: trunk/src/org/openstreetmap/josm/tools/ImageResource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 16924)
+++ trunk/src/org/openstreetmap/josm/tools/ImageResource.java	(revision 16926)
@@ -297,4 +297,10 @@
      */
     public ImageIcon getPaddedIcon(Dimension iconSize) {
+        final ImageIcon imageIcon = getImageIcon(iconSize);
+        if (imageIcon.getIconWidth() == iconSize.width && imageIcon.getIconHeight() == iconSize.height) {
+            // fast path for square and svg icons
+            return imageIcon;
+        }
+
         final Dimension cacheKey = new Dimension(-iconSize.width, -iconSize.height); // use negative width/height for differentiation
         BufferedImage image = imgCache.get(cacheKey);
