|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
Name: rlT66838 Date: 07/14/99
We have profiled our Java program and one of
the places it is spending the most time is in
GridBagLayout allocating new arrays. For example:
GridBagLayoutInfo () {
minWidth = new int[GridBagLayout.MAXGRIDSIZE];
minHeight = new int[GridBagLayout.MAXGRIDSIZE];
weightX = new double[GridBagLayout.MAXGRIDSIZE];
weightY = new double[GridBagLayout.MAXGRIDSIZE];
}
This method is called many times. It allocates
arrays of MAXGRIDSIZE (512) ints and doubles.
Also there are other allocations of arrays of
[MAXGRIDSIZE] elements. MAXGRIDSIZE is a static final
int so a class can't even extend GridBagLayout and
change its value.
How about adding setMaxGridSize() to GridBagLayout,
or a new constructor GridBagLayout(int maxGridSize)?
(Review ID: 85571)
======================================================================
|