[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: JComponent optimization
From: |
Roman Kennke |
Subject: |
[cp-patches] FYI: JComponent optimization |
Date: |
Mon, 10 Oct 2005 10:56:26 +0200 (CEST) |
User-agent: |
SquirrelMail/1.4.4 |
Hi,
I optimized one of the hot spots in Swing a little. The paintChildren
method used to call Component.getBounds(), which always allocates a new
Rectangle objects. I replaced this by Component.getBounds(Rectangle) and
made it reuse a static transient Rectangle field. This works quite well
and should reduce Rectangle allocations significantly.
2005-10-10 David Gilbert <address@hidden>
* javax/swing/JComponent.java
(rectCache): New field. Caches Rectangle objects for reuse.
(paintChildren): Changed to reuse cached Rectangle object.
/Roman
JComponent.diff
Description: Text Data