I am planing to setup all of controls ( more than 100 visible ) on a Flex application to alpha be开发者_C百科low 1, which will make them a bit transparent, but i am wondering if this will affect the performance of the application. So :
- I would like to know if alpha actually affecting performance on Flex applications ?
To add to @Constantiner's answer, every filter and effect (including alpha) will affect performance. This is the case in any framework you work with... not just Flex. If you think about it, it makes sense...
You see, without any effects or filters, what gets displayed is straight forward... it is just a pixel. If the pixel is in front of every other pixel on the Z axis, it gets displayed. If not, it doesn't get rendered. No math. Very easy for the computer to manage.
In your case, you are changing the alpha. Now, for every pixel in front with an alpha value less than 1, you ALSO have to render to content behind it. Not only do you need to render the content behind it, you need to blend the pixels in order to get the transparent effect.
Of course, the framework and GPU take care of this work for you... but it comes at a cost. I am not suggesting that you don't use alphas. Just know that every time you add an effect or filter (drop shadows, glows, alpha blends, blurs, etc), the system has to do a lot more math for you. Your frame rate is directly affected by this... but it also produces a much better experience for your user.
Use that knowledge to make an educated decision. Does the effect/filter add value? Does the alpha move around a lot like in a scrolling list box (causing re-rendering to happen more often)? Will this extra overhead be OK?
EDIT: Take a look at this presentation from 360Flex about optimizing Flex performance. I think it is very useful: http://zaa.tv/2011/06/360flex-denver-2011-flex-performance-tips-and-tricks/
Yes, it potentially affects performance. So use it wisely.
I mean if you're using controls with constant background there is no problems with it. But if you have a lot of objects which moves or added/removed to stage often you can have some performance issues.
精彩评论