简体   繁体   中英

Avoiding <fx:declarations> tags in mxml classes to boost performance?

According to "The bAS3 Class", all declarations in a mxml class that are within a <fx:Declarations> tag are in fact bindable. [source] .

So now I'm wondering what that does to the application's performance. To boost maintainability in my code, I've made quite a lot declarations like that, but since I'm developing a mobile app, I'm after the maximum performance I can get.

Is it advisable to ditch the <fx:Declarations> stuff altogether in favor of performance? I know that binding is quite heavy in flex, which is why I avoided it wherever possible.

I highly doubt if declarations would hinder performance that much, unless the declarations are Factory objects that are used to create hundreds of components. But it is correct that heavy databinding could eat into performance if the binding properties change a lot, so that would be the first thing to improve. Remedy would include using [Bindable("eventName")] instead of just [Bindable], or ditch databinding, and use direct events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM