Thursday, October 23, 2008

Flex performance tips

One of the most interesting sessions I assisted in MIF Onsite III was "Flex optimization" by Alberto Alacaraz. He talked about optimizing Flex applications, performance and memory usage, and some tips to achieve it by using the Flex Profiler.

Performance/memory usage are both equally important issues while developing successful applications, but focusing in performance, it's a key aspect when talking about user experience. When working with interactive aplications, the user expects an inmediate response to a button click, or a key press, a drag & drop... and if these events fire any inefficient processes, the overall user impression about the application can be damaged.

Alberto pointed some simple tips to have in mind when coding Flex applications. Very simple things in fact, but I often forget those when coding...

  • Remembering ActionScript statements such as "break" or "continue" when iterating in loops can save some precious time. Come on, review ActionScript3.0 statements!
  • Bindings in Flex are very powerful, but involve some overhead we must be aware of. They are very useful to ensure we're displaying the latest data in our views, but do we want to notify the view of every change we make over this data? Perhaps notifying sets of changes, between consistent states could be enough...
  • The object pool pattern, that a very elegant way to improve object instantiation times.

Here, I try reproduce some of the examples Alberto showed (here the source code):





2 comments:

Unknown said...

Hey Marc, I'm glad to know that you enjoyed the preso. I'll upload the slides and the code in a few days. BTW very nice examples! :P

Regards,

Alberto

Marc Baiges Camprubi said...

thanks Alberto :-)
great, I'm looking forward to see them!

MAXwidget