-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
beta
-
x86
-
windows_nt
BufferedImageGraphics2D.drawLine has a fairly serious performance hole.
Every time it is executed it checks where it has a
DrawLineRasterContext allocated. If not it tries to allocate one.
This may or may not succeed. It then draws the line.
Unfrotunately it doesn't remember if it *fails* to allocate a
DrawLineRasterContext. Unfortunately if the graphics context
is such that it can't get one, it still pays a significant
time and memory cost each time through drawLine trying to
allocate one.
This showed up in the Swing startup code during the painting of
MetalBumps. Even after that code was changed to avoid doing
setColors, repeated calls on drawLine with the same graphics
context were causing a large memory leak.
This was adding three seconds to Swing startup on a 150 MHz pentium.
See the workaround section for a change to the drawLine method
that removed that overhead.
graham.hamilton@Eng 1998-06-08
- relates to
-
JDK-4146836 MetalBumps initialization code does too many setColors
-
- Closed
-