PropertyPanel is used as cell renderer in
TreeTableView. Common good technique of
implementing getComponent() of renderer is to
return still the same component, with different
Unfortunately, PropertyPanel.setModel is too slow
for this purpose. The result is that we have to
create and cache hundreds of various
PropertyPanels, which eats memory (and is
complicated and not blazingly fast either).
Attached is output from optimization tool, when
TreeTableView was modified to call
PropertyPanel.setModel from getComponent.
Created attachment 10003 [details]
output from optimization tool showing time distribution of repaints of TreeTableView
Adding to PropertyPanel rewrite umbrella (propertypanel should
reuse rendering infrastructure from new property sheet). It
will happen after property sheet is finished.
PropertyPanel is currently way too heavy to use as a cell
renderer (blame it on SheetButton).
You might be able to get some better performance if you
can cache and reuse some of your PropertyPanels - I don't
know what your code did - if it created new instances per
Also, it looks like one performance hit is getPropertyEditor(). I'll
attach a patch I would like to
incorporate into Node (it was committed once and removed,
but Jesse now approves it), to do soft cacheing of property
editors. Maybe it will help a little for now.
Created attachment 10008 [details]
Patch to Node for soft cacheing property editor
FYI, this should be fixed soon - I've got a rewrite of PropertyPanel
which should be considerably faster, using the property sheet's
The amount of work going on in TTV is indeed terrifying (since I have
a bunch of logging code embedded in PropertyPanel right now, I get
to see just how much).
I hope to be able to expose publicly a method like
renderProperty (Graphics g, Property p, Rectangle r)
JComponent getPropertyRenderer(Property p)
which will render the property correctly and very, very quickly
I just tried optimizing TTV to reuse a single property panel for
painting, using the property panel from the proppanel_rewrite2
branch. I made sure the new property panel was pretty heavily
optimized for this use case.
WOW. The options dialog seems to come up in about 1/4 the time
as before, and navigating between panes in the Import Management
Tool is almost instantaneous.
I had no idea PropertyPanel was so much of TTV's problem.
Property panel rewrite branch merged.