开发者

Slow Spark List Initialization with custom renderer

开发者 https://www.devze.com 2023-03-11 11:45 出处:网络
I have a Spark list with a customItemRenderer that is taking a good 3 seconds to initialize wit开发者_如何转开发h just 50 items.

I have a Spark list with a customItemRenderer that is taking a good 3 seconds to initialize wit开发者_如何转开发h just 50 items.

I'm using Flex 4.5, my ItemRenderer is already very optimized, using as little nesting as possible, fxg and so on.

Is anyone having similar issues? I've tried almost everything in the book bar going back to mx.


So the issue was due to the way that spark handles styling the issue is detailed here: http://bugs.adobe.com/jira/browse/SDK-29880 and can be sorted by monkey patching with: http://taytay.com/?p=169 Also removing global css selectors "*" helps.


Avoid HGroup and VGroup as much as possible, use absolute layout instead. I've had this same problem at that's fixed most of it for me. 1 hgroup + 1vgroup each three times = 6 automatic layouts PER ITEM. So in total you have 150 objects, WAY too much.


After applying the monkey patch mentioned by Pedro with only modest performance gains (I suppose we had fewer styles, or the performance was fixed in a more recent patch), I continued profiling the initialization of our List instances.

One thing I found is that Flex spends quite a lot of time in UIComponent's initializeAccessibility function, even though our application does not support accessibility in any way (whether applications ought to do that is an entirely different issue).

Merely adding -accessible=false to the compiler arguments cut time spent initializing a particularly heavy list by about a third! Not only that, the whole application in general feels snappier when windows are opened, controls are shown for the first time, etc. If you have no need of accessibility support, you might want to check this out - if you do, I'm sure something can be done to fix the abysmal performance of initializeAccessibility - simply through overriding it in your component implementations, or through even more monkey patching :-)


Are your item renderers checkboxes by any chance? A few folks have recently run into a bunch of performance issues with Spark in general.

http://blogs.adobe.com/aharui/2011/04/migratory-foul-performance-problems-migrating-from-flex-3-x-to-flex-4-x.html

Adobe has been notified, and apparently are working on it: https://bugs.adobe.com/jira/browse/SDK-29451

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号