Flash性能分析器 TheMiner

码农软件 · 软件分类 · 性能测试和优化 · 2019-11-27 19:43:42

软件介绍

The Miner是由加拿大的Jean-Philippe Auclair(jpauclair.net)开发的Flash性能分析器(profiler),其前身为开源的FlashPreloadProfiler。The Miner虽然现在已“沦为”商业软件,但其个人非商业用途(比如学习研究,开源项目)仍可以免费自由下载使用。前往TheMIner官方网站 The Miner是完全绿色的软件/类库,提供两种使用模式:

准备:

1、确认你的FlashPlayer为debug版,检测你的FlashPlayer

2、下载The Miner类库,或者去官网下载页面

使用方法1:

1、在或者FlashBuilder项目FlashDevelop中,将下载的类库解压后SWC文件夹中的TheMiner_zh-cn.swc (简体中文版,你可以选择其他语言)放到你的lib目录下,或者“项目”>“属性”>“Flex构建路径”>“库路径”>“添加SWC”;

2、导入TheMiner

在舞台上加载TheMiner

例:

 

package
{
    import com.sociodox.theminer.TheMiner;
    import flash.display.Sprite;
    import flash.events.Event;    
 
    public class MinerTest extends Sprite
    {
 
        public function MinerTest ()
        {
            this.addEventListener(Event.ADDED_TO_STAGE,init);
        }
 
        private function init(e:Event):void{
            stage.addChild(new TheMiner());    
            this.removeEventListener(Event.ADDED_TO_STAGE,init);
        }
        }
}

 3、现在只需要F11调试运行SWF即可,你会发现在SWF窗口上侧多了一横条工具栏,上面有很多小按钮,还显示了当前FPS和内存占用值,比如点击第二个按钮“即时状态”,会显示更详细的flash状态信息:

theminer

 另有更强大的“记忆体分析器”、“效能分析器”、“载入器分析器”等:

 上面的“记忆体分析器”很像FlashBuilder自带的概要分析器吧,显示了每个类(如Shape、MovieClip、ByteArray、Bitmap等)的实例数变化和内存占用,能帮助你快速判断哪些实例是多余该被清除的。

“效能分析器”就更底层了更强大了,会精确到微秒(μs)级显示定时器、渲染器、网络连接、绘图、帧事件等个函数的运行耗时及百分比,针对这些,开发者就可以对症下药,优化SWF运行效率。

“载入器分析器”会展示每个Loaderde的运行状态、大小、目标,而且还提供筛选功能。

此外,还有其他实用工具,如鼠标时间、显示重回区域、显示物件状态、内部事件分析器、SWF窗口截图、复制信息到剪贴板、最小化/关闭TheMiner等。

4、最后,在发布Flash的时候,注释掉相关代码即可。

使用方法2:

方法1很简单,不过如果有大量不同的项目需要测试,或者你希望对你今后的没一个Flash作品都有这样的测试的话,方法1就很麻烦了。对此,TheMiner提供了Pre-Launcher预加载的方法,首次简单的“安装”后,可统一的对本机上所有的SWF做性能测试。

原理也很简单,设置FlashPlayer启动时,首先加载TheMiner.swf,这样Flash每次运行时候先加载TheMiner作为载体,然后将要打开的目标SWF加载到TheMiner中,使要打开的SWF在TheMiner控制之下,这样就可以直接测试了。

1、将下载的类库解压后SWF文件夹中的TheMiner_zh-cn.swc放到C盘根目录,并重命名为TheMiner.swf,即C:TheMiner.swf。

2、到Flash Global Security Settings Flash Player全局安全设置中

(即打开该网页http://www.macromedia.com/suppor ... ings_manager04.html
在该网页的SWF编辑多个位置-〉添加位置-〉信任此位置,中依次填入:

如:

theminer

3、在C盘中找到mm.cfg文件(XP:C:\Documents and Settings\Administrator\mm.cfg, WIN7:C:\Users\Administrator\mm.cfg),用记事本打开,写入下面内容,然后保存。

mm.cfg文件是什么?

OK,现在只要随意启动一个SWF,就可以用TheMiner做效能分析了。

成功安装后,如果想要临时暂停使用The Miner,只需要将C盘中那个TheMiner.swf重命名(比如重命为"_TheMiner.swf","TheMiner._swf"等)即可,恢复使用只需要再改回原来的名字TheMiner.swf。

本文地址:https://codercto.com/soft/d/19931.html

Agile Web Application Development with Yii 1.1 and PHP5

Agile Web Application Development with Yii 1.1 and PHP5

Jeffrey Winesett / Packt Publishing / 2010-08-27

In order to understand the framework in the context of a real-world application, we need to build something that will more closely resemble the types of applications web developers actually have to bu......一起来看看 《Agile Web Application Development with Yii 1.1 and PHP5》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具