7 Replies Latest reply on Jan 12, 2011 12:11 PM by Flex harUI

    Explanation of performance results

    FredericCox Level 1

      Hello,

       

      As I'm still working on optimizing an application I am using the Profiler and measuring performance problems. Can anyone help me with the analysis of this one? I'm unclear on what exactly is the problem here. When I look at this the problem seems to be in the styles area. Is this about using setStyle to much or using CSS (css file is 4500 lines..) too much? We also use a lot of skins but this is the purpose of Flex 4 so .. :-)

       

      Also the cumulative time is the time it took for everything to run, so the top cumulative time is the total time of all things processed?

       

       

      Note: The blue highlighted row is the most intensive function from my code, all above is flex

       

      Thanks for any help

       

      afterlogin.png

        • 1. Re: Explanation of performance results
          Flex harUI Adobe Employee

          The results indicate that styles are taking up a significant amount of time.

          We don't know the duration of your sample, so we don't know if that is

          important to you or not.  It is odd that styles code is at the very top

          since it usually gets called by something and that something's cumulative

          time is usually at the very top.  Make sure all of your filters are off.

           

          I also noted more than a dozen calls to doPhasedInstantiation which

          indicates that there might be inefficiency in how UI widgets are being

          created and initialized.

          • 2. Re: Explanation of performance results
            FredericCox Level 1

            Hi,

             

            Thanks for helping me out!

             

            Flex harUI wrote:

             

            The results indicate that styles are taking up a significant amount of time.

            We don't know the duration of your sample, so we don't know if that is

            important to you or not.  It is odd that styles code is at the very top

            since it usually gets called by something and that something's cumulative

            time is usually at the very top.  Make sure all of your filters are off.

             

             

            We are loading styles from a SWF file at runtime, I don't know if that has anything to do with it. I have now removed filters and will check performance tomorrow again

             

            I also noted more than a dozen calls to doPhasedInstantiation which

            indicates that there might be inefficiency in how UI widgets are being

            created and initialized.

             

            What happens mostly in this application is that there is too much code for one frame so the rendering freezes, therefore I have used some callLater calls to spread execution accross frames and that made it run smoother, maybe that is why?

            • 3. Re: Explanation of performance results
              Flex harUI Adobe Employee

              Loading a CSS SWF will be expensive.  Some folks use custom preloaders to

              load the SWF before the app gets very far.

              • 4. Re: Explanation of performance results
                FredericCox Level 1

                We load it on the initialize handler of the application, can it be done sooner?

                 

                We use StyleManager.loadStyleDeclarations which I think is the only way or not?

                 

                callLater seems to help a lot already, for example we have a container with 36 comboboxes and it takes 2 seconds to add them all and another 2 seconds if we use a skinClass on it so what we did is create the 36 comboboxes accross multiple frames using callLater

                 

                I'm going to investigate further and optimize and will get back with the results

                • 5. Re: Explanation of performance results
                  Flex harUI Adobe Employee

                  Yes, a custom preloader can do it after the RSLs load and before initialize.

                  It blocks the initialization events to the app, calls loadStyleDeclarations,

                  then when the styles are loaded, continues with the initialization of the

                  app.

                  • 6. Re: Explanation of performance results
                    FredericCox Level 1

                    Do you have maybe some example code for this?

                    • 7. Re: Explanation of performance results
                      Flex harUI Adobe Employee

                      See the other custom preloader threads going on right now.