2 Replies Latest reply on Jan 31, 2013 7:14 AM by damian_pope

    Red Line is Time Budget Average?


      I have a question about the horizontal red line in the Frame Timeline window. I understand it keeps track of the 'time budget'. If all the bars are below it, the swf file is running at the desired frames per second. If some of them are above it, your swf file's running slow. Right?


      My question is this:

      Is the red line related to average performance over a certain period of time?


      I ask as I've noticed as all of my bars (in the Frame Timeline window) are below the red line. But when I click on a few individual frames, the Summary window tells me that the Framerate is under the target framerate, i.e. the bar should rise above the red line.

      So, I'm a little confused. I've attached a screenshot which I hope it clear enough to read.


      The desired framerate is 40 fps and the current instantaneous framerate is 29.9 fps. But the bar is below the red line.




      Also,  I'd assumed that the scale on the vertical axis of the Frame Time bar chart was linear.

      i.e. if a frame took twice as long, the bar would be twice as high.

      But I've noticed that this doesn't always seem to be true.


      My guess is that framerates naturally fluctuate from frame to frame a bit and Scout is doing some sort of time-averaging and smoothing. But I could be completely wrong! I'm still trying to work my way around Scout. Many thanks for your help!




      BTW, Scout is amazing! An incredible tool.

        • 1. Re: Red Line is Time Budget Average?
          Gavin Peacock Adobe Employee

          Your code is the colorful stuff, not the grey stuff. The lower the colorful stuff is under the bar, the better your code is running. Your code looks good here.

          You are running at 31% of your budget 25ms per frame (it says so in the Summary panel). 25 ms is 1000ms/40fps.


          The red line represents the desired SWF frame rate. This is usually set when you create the SWF file in FlashPro, FlashBuilder, or other tools. It can also be set in directly in ActionScript code. Since yours is at 40, you must have already set it somewhere.

          You need to look at the grey bars. Grey represents time waiting for the next frame, not the time spent running your frame. Grey is good. If you don't see any grey below the red line, your code is taking too long to run in that frame. The grey bars are showing you the actual intervals between each frame. In your case these are alternating above and below the line. If you select a range of frames, you will find that the average is right at 40, but each individual frame time will be more or less. The flash player has an internal algorithm to average these intervals to make your desired rate. The player prefers rates that are divide evenly into 60, like 60, 30 or 15. If you choose other rates, it will adjust the frames so that they fit into this pattern. So you are seeing alterating frames which average nicely to 40fps. This is normal player behavior. it does this so that multiple flash sessions don't put too much demand on the CPU by only waking up in reliable intervals.

          • 2. Re: Red Line is Time Budget Average?
            damian_pope Level 1

            Thanks Gavin! This makes total sense. I think I get it now. I got confused and thought that the big number under Framerate in the Summary panel was related to just the active time in the frame. So any time it was below the target framerate, I got concerned. I now see it's the total frame time - active time plus inactive time. And that's it's natural and totally fine for it to fluctuate a little. This helps a lot. Grey is good! Thanks again.