Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 18501)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 18502)
@@ -8,5 +8,4 @@
 import java.util.Objects;
 import java.util.Optional;
-import java.util.stream.IntStream;
 
 import org.openstreetmap.josm.data.osm.INode;
@@ -351,6 +350,12 @@
     }
 
-    private static int max(int... elements) {
-        return IntStream.of(elements).max().orElseThrow(IllegalStateException::new);
+    private static int max(int a, int b, int c, int d) {
+        // Profile before switching to a stream/int[] array
+        // This was 66% give or take for painting nodes in terms of memory allocations
+        // and was ~17% of the CPU allocations. By not using a vararg method call, we avoid
+        // the creation of an array. By avoiding both streams and arrays, the cost for this method is negligible.
+        // This means that this saves about 7% of the CPU cycles during map paint, and about 20%
+        // of the memory allocations during map paint.
+        return Math.max(a, Math.max(b, Math.max(c, d)));
     }
 
