Skip navigation
Currently Being Moderated

Screen is getting slower and slower

Mar 20, 2013 5:12 PM

I have a screen where I am using three different types of controls: TextInputs, Comboboxes, and Dates. All controls are highly customized controls with custom skins and stuff.

I have discovered that because of Dates controls the screen is getting slower to open after every run.If I use Flex native DateField controls then I have no problem. I am comparing custom DateDileds with natives ones and basically the difference is skins. I tried to get rid of all custom code but the problem is still there. Any thoughts what can cause this growing time?

 

Thanks

 
Replies
  • Currently Being Moderated
    Mar 20, 2013 9:23 PM   in reply to Zolotoj

    Use the profiler to see what is taking longer.

     

    One common mistake in custom drawing code is to not call graphics.clear().  Then on every drawing pass you draw another set of visuals on top of the old ones and the number of total vectors keeps growing.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 8:48 AM   in reply to Zolotoj

    If you add them on every run, how are you removing them?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 9:00 AM   in reply to Zolotoj

    Well, it kinda looks like some resource or other isn't getting destroyed. It's a question of finding it.

     

    Perhaps you could put a breakpoint before you add new controls, to see if those controls haven't been removed.

     

    Perhaps you have strong event listeners that are preventing the controls being garbage collected.

     

    Perhaps..

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 9:27 AM   in reply to Zolotoj

    How many controls are you adding on each run?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 9:35 AM   in reply to Zolotoj

    Difficullt to say. I was expecting you to say a lot more than that. They aren't all tables with zillions of rows?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 21, 2013 3:15 PM   in reply to Zolotoj

    Use the profiler to see if the old ones are going away or not.

     

    It doesn’t take that many controls to add up to lots of skin pieces and slow down the player.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 22, 2013 9:29 AM   in reply to Zolotoj

    If the old ones don't go away, you need to look at the mechanism that would remove them - because it doesn't work.

     

    The other approach would be to cache the controls and re-use them rather than remove and recreate them. It all depends on what it is that you're doing.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points