tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/626-rl15-performance-issueRobotlegs: Discussion 2012-08-27T10:38:37Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-26T23:38:01Z2012-07-26T23:38:01ZRL1.5 Performance issue<div><p>Um. So, you are creating 8000 to 9000 MC-like (or more complex)
objects, and you are experiencing a slow down? That is a lot of UI
elements. Have you tried to create these UI elements without or
outside of RL? IE. is the slow down perhaps simply do to the number
of items being rendered/instanced?</p>
<p>Perhaps turn off auto-mediation? I'm hoping that you are not
mediating <em>each</em> of these UI elements, but some parent
element. I know that the auto-mediator listener can slow things
down where there are a lot of items being added to the stage at the
same time.</p></div>Jos Yuletag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-27T00:54:19Z2012-07-27T00:54:33ZRL1.5 Performance issue<div><p>Hi, It's because of Robotlegs Automediation of views. Every
added element is parsed. Check out this thread about the same
topic. <a href=
"http://knowledge.robotlegs.org/discussions/problems/65-massive-performance-problem-with-robotlegs-need-advice">
http://knowledge.robotlegs.org/discussions/problems/65-massive-perf...</a></p>
<p>Regards,<br>
Mike</p></div>Michal Wroblewskitag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-27T01:44:39Z2012-07-27T01:44:39ZRL1.5 Performance issue<div><p>Hello,</p>
<p>Robotlegs auto mediation does indeed slow things down a little,
but only when the app is already in trouble. In other words, the
performance impact is greatest when the app already has too many
deeply nested or densely packed views, in which case the Flash
Player struggles anyway.</p>
<p>In Flex it's incredibly easy to create deeply nested views -
HGroups nested inside VGroups nested in Skins wrapping components
etc etc. Even without Robotlegs in the picture it's always
important to aim for the flattest structures possible. The
ConstraintLayout is a great way to keep your layouts flat instead
of nesting HGroups and VGroups. Have a quick read though this:
<a href=
"http://www.adobe.com/devnet/flex/articles/flex-mobile-performance-checklist.html">
http://www.adobe.com/devnet/flex/articles/flex-mobile-performance-c...</a></p>
<p>If you have a moment, and are willing, you could run a little
tool I wrote that grabs some stats relating to the complexity of
your app's display list: <a href=
"http://shaun.boyblack.co.za/blog/2011/08/16/show-me-your-tree/">http://shaun.boyblack.co.za/blog/2011/08/16/show-me-your-tree/</a></p>
<p>Be sure to run the tool when your app is at its most complex
(i.e. when the most view components are on stage). Also, have a
look in the comments of that blog post to get a feel for the
complexity of some real world Flex/Flash apps.</p>
<p>Once you've flattened your layouts, skins and components, your
app should run smoothly with or without Robotlegs.</p>
<p>Hope that helps.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-27T02:03:26Z2012-07-27T02:03:27ZRL1.5 Performance issue<div><p>Hey guys,</p>
<p>Thanks a lot for your comments,these are really helpful.</p>
<p>Shaun,</p>
<pre>
<code> I agree what you said..I tried your tool on one of my app's View and below is the stat, can you please let me know, what does this mean now?</code>
</pre>
<p>FYI: its an AIR App in FB4.6</p>
<p>All Container Stats<br>
Containers: 795 total<br>
Children per container: 51 max, 1.35 avg<br>
Depths (distance): 10 max, 5.78 avg<br>
Unique container types: 48 total</p>
<p>Unfiltered Container Stats<br>
Containers: 257 total<br>
Children per container: 9 max, 0.74 avg<br>
Depths (distance): 8 max, 5.48 avg<br>
Unique container types: 27 total</p>
<p>Filtered (mx., spark., flash.) Container Stats<br>
Containers: 538 total<br>
Children per container: 51 max, 1.65 avg<br>
Depths (distance): 10 max, 5.92 avg<br>
Unique container types: 21 total</p>
<p>Thanks<br>
Dev</p></div>Devtag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-27T11:26:08Z2012-07-27T11:26:37ZRL1.5 Performance issue<div><p>You can install this utility: <a href=
"https://github.com/eidiot/robotlegs-utilities-LazyMediator">https://github.com/eidiot/robotlegs-utilities-LazyMediator</a></p>
<p>And then add this to the declaration blocks of any view
components that need mediation:</p>
<pre>
<code><LazyMediatorMxmlActivator view="{this}" /></code>
</pre>
<p>The utility turns off auto-mediation, and the tag makes view
components dispatch relevant events. Give it a try (you said you
only had 8-10 mediated views, so it shouldn't take long to put in
place), and let us know how it goes. If it doesn't help much, then
your layouts are simply too complex. Even if it helps, I'd still
recommend trying to optimise all your view components, layouts,
skins etc.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-28T17:42:53Z2012-07-28T17:42:54ZRL1.5 Performance issue<div><p>Hey Shaun,</p>
<p>Thanks for this, I tried using this utility, not sure if I
implemented it correctly, here is what I did.<br>
1. In custom Context, which is extending the Context Class, I
override the mediatorMap getter method with "return _mediatorMap ||
new LazyMediatorMap(contextView, injector, reflector));"<br>
as described in read me file on github.</p>
<p>And then added the to all the view components which are being
mediated.</p>
<p>rest of the old RL implementation is same, I didn't modify any
other stuff related to RL's mapEvent, mediatorMap, mapCommand
etc.<br>
Things are working fine, but I don't see any change in performance,
please correct me if I implemented it wrong.</p>
<p>I am going though the view components optimization as well, but
I hardly see any section that needs any further optimization. All
the layouts are simple having 2-3 main containers(s:Group) and
adding things at run time to them (custom components to display
data with some MXML graphics/skins).</p>
<p>Thanks for the Help!</p>
<p>Thanks<br>
Dev.</p></div>Devtag:robotlegs.tenderapp.com,2009-10-18:Comment/176198692012-07-28T17:53:09Z2012-07-28T17:53:09ZRL1.5 Performance issue<div><p>Hi Dev,</p>
<p>Hmm.. it sounds like you implemented the Lazy utility just fine,
but as it doesn't improve performance, then it is not
auto-mediation or the framework that is slowing things down. In
which case the only thing you can do is carefully analyse what is
going on through a Profiler. Something is causing the performance
problems - it could be anything really. I'm afraid I can't help
much with this, you'll just have to dig in as deep as you can. Best
of luck!</p></div>Shaun Smith