threerings/tripleplay — Issue #10: Vertical Layout with Tripleplay way too slow for trivial number of widgets.
Author: dmg46664
Created: 2011-12-31 15:10:34+00:00
State: open

What steps will reproduce the problem?
1. Open the playn-showcase-java
2. Set a breakpoint in AxisLayout.computeMetrics(...) or rather Vertical.layout(...)
3. see how long it takes to complete the layout for only a trivial number of elements.

Maybe I'm in error, but it seems to me that there's something wrong with the following stack trace when doing the layouts of the Elements with tripleplay:

AxisLayout$Vertical(AxisLayout).computeMetrics(Elements, float, float, boolean) line: 193
AxisLayout$Vertical.computeSize(Elements, float, float) line: 67
Group(Elements).computeSize(float, float) line: 180
Group(Element).preferredSize(float, float) line: 359
AxisLayout$Vertical(AxisLayout).computeMetrics(Elements, float, float, boolean) line: 193
AxisLayout$Vertical.layout(Elements, float, float, float, float) line: 75
Root(Elements).layout() line: 196
Root(Element).validate() line: 318

Not that there is technically anything wrong with recursively computing size metrics... but that computing a single button takes near 2 seconds on my Alienware dual-core in the native java mode is a tad ridiculous. (and no, I shouldn't have to buy a i7)

I just wanted to flag this to get recognition that this is a known issue, as it wasn't in the issue tracker. And hopefully that someone more familiar that I would work on it. Although if someone is willing to give me a run down on why it works the way it does, I'm not unwilling to contribute :-)

Thanx for creating a UI library for PlayN! I had abandoned my app with Forplay because no such library had existed and it all seemed too hard.

Regards
Daniel