My idea is to simply add a performance monitoring tool during Flash Player running.
This helps me understand some of its situations. The framestats tool helps you determine that flash player is executing code.
It is still rendering or both.
This tool is developed using pure as3.
And add the following code to your display object container (displayobject container ).
This. addchild (New framestats (this ));
In the flex project, you can place it in the uicomponent component
Because this component class is also a subclass of Sprite
Protected function creationcompletehandler (): void {
VaR componenent: uicomponent = new uicomponent ();
Componenent. addchild (framestats );
Framestatsholder. addelement (componenent );
}
<S: Group ID = "framestatsholder"/>
Download
(24.84 KB) the day before yesterday
Figure 1
This tool displays the following phases:
Construct a code structure to display the container code and display sub-class execution
• Constructor code-construct the code to be executed in the display object container and its subclass.
The time is the event. enter_frame and event. frame_constructed events.
Time consumed
• Frame action frame actions-code in the object container and its sub-objects is executed;
Time is the time consumed between event. exit_frame and event. frame_constructed events.
• End User code-Listen to the rendering Event code and change the last time the object is displayed.
• The displayed object is changed-player
Changes in the display objects in the rendering display list are displayed on the screen. The displayed time is the time elapsed from the final user code to the next entry to the frame event.
Download
(12.57 KB) Downloads: 63 the day before yesterday
Source code:
Framestats.rar
(3.7 KB)
Explanation:
The Flash Player is a single-threaded player. Every frame of the flash player tries to complete the display list required for encoding and rendering. Until flashplayer
No changes have been made before version 10.1. This means that FP needs to complete the code execution and rendering tasks within each frame. If it cannot be completed within a single frame, the frame rate will be automatically changed so that each frame
To complete the two tasks. This means high CPU and memory usage and poor user experience.
Flashplayer
Version 10.1 is addressing this problem. For example, the adaptive rate is increased by 10.1. If both tasks are completed, the frame rate is seriously affected. It will give priority to ensuring code execution and ignore rendering tasks.
The frame rate will not be reduced to an unacceptable level. When 10.1 detects that the backlight enters the off state, it also enters sleep mode. In this mode, rendering will be paused and the frame rate will be reduced to 4 frames per second.
Note: It is energy-saving but has no loss of functionality !). 10.1 priority will also be considered. For example, if you load
.
It does not need to be displayed on the screen (not displayed), so it will delay loading. In addition, FP will automatically pause the playback of the invisible and off-screen SWF.