3 Replies Latest reply on Apr 29, 2010 3:13 AM by Karl_Sigiscar_1971

    Flex performance issues

    Saritha S

      hi

       

      By using an mvc architecture ,is it possible to overcome Flex performance issues...???

       

       

       

      Thanks

      Saritha S

        • 1. Re: Flex performance issues
          David_F57 Level 5

          hi,

           

          there are lots of ways to improve performance through,  better resource management, avoiding gotchas like on enter frame, preserving best practices with oop etc... . But mvc/design patterns are basically about layers of abstraction and they lead to one thing "performance degradation". No matter how you want to sell it, having 2-3 layers between clicking a button and actually performing the required action will always create  performance losses.

           

          You need to play to the flashplayer's strengths not its weaknesses and this is something many modern programming techniques aren't interested in.

           

          In the old days you had 3 parts of a program - interface(view), functionality(model) and application(controller), you used software architecture(design patterns), so despite the academic hype MVC/design patterns are just a cruel joke on the development world as the only real change was the added BS associated with 'buzzing' it up to make something look newer and better. OOP was a natural progression in development, especially as we moved to event driven programming, the rest i'm not to sure about.

           

          David.

          • 2. Re: Flex performance issues
            Saritha S Level 1

            hi

             

             

            thank u so much...

             

            thanks

            saritha

            • 3. Re: Flex performance issues
              Karl_Sigiscar_1971 Level 3

              Excuse me ? If you develop a large scale application, you had better use a MVC architectural framework (with or without dependency injection) and additional design patterns like the presentation model. Otherwise, you will end up with code complexity as you try to overcome the inevitable structural problems as the application grows and THIS will end up in performance degradation.

               

               

              -          Run the profiler to identify bottlenecks and memory leaks: number of instances of a given class, execution time of methods, memory usage … E.g item renderers

              -          How much data is loaded, processed and displayed at any one time can have a big impact on performance. Reduce the amount of data: paging via parameter to the service

              -          Reduce the layout complexity: remove containers so nestLevel <= 4

              -          Remove event listeners: addEventListener () calls with corresponding removeEventListener() calls (do not use addEventListener() with weak reference as it decreases performance)

              -          Deferred instantiation of UIComponents (e.g Viewstack children) aka lazy instantiation

              -          Garbage collection: check Grant Skinner’s checklist

              -          Interrupted execution of complex functions (especially when looping on a large data set): the function monitors its execution time and yields (returns) when the current call exceeds a given duration (usually, that of a frame at 24 fps, which is the default Flex framerate). It is called again on the next frame and so on and so forth until processing is complete. You can use callLater() for that.

              -          Lazy loading of data

              -          Use more efficient code. Favour re-use of existing code in the Flex framework rather than re-writing what exists. Favour simple solutions over complex ones when possible.

              -          UID getter/setter in DTOs for improved performance in sorting / filtering of Array Collections

              -          Too many data bindings decrease performance. Mainly use data binding to bind views to the presentation models. Use the ChangeWatcher class or direct assignment of values when possible.

              -          Limit the number of calls to setStyle(). Use style declarations in CSS when possible.