[osflash] profiler tool

Simon Wacker Simon_Wacker at gmx.de
Sat Jun 4 03:14:35 PDT 2005


Hi Johannes,

the as2lib has an api for profiling, org.as2lib.test.speed. You can download 
the as2lib here: http://plone.as2lib.org/download. There is no tutorial 
available on how to use it, I'll thus show you the basics here. For a quick 
understanding of the api you can take a look at the api documentation on: 
http://api.as2lib.org.

Usage:
The first thing you must do is collect all test cases. A test case is 
supposed to be a method or property that you want to profile. You can do 
this with the TestSuiteFactory 
(http://api.as2lib.org/org_as2lib_test_speed_TestSuiteFactory.html). If this 
is done you can run the tests. This will place wrappers around every method 
you want to be profiled. You can now execute the normal instructions of your 
application. After that you can obtain the test suite result for you given 
layout, sort it if you want and for example trace it to the output panel.

import org.as2lib.env.reflect.PackageInfo;
import org.as2lib.test.speed.TestSuiteFactory;
import org.as2lib.test.speed.TestSuite;
import org.as2lib.test.speed.TestResult;
import org.myproject.MyClass;

var testSuite:TestSuite = new 
TestSuiteFactory().collectTestCases(PackageInfo.forName("org.myproject"));
testSuite.run();

var myInstance:MyClass = new MyClass();
myInstance.myTimeConsumingMethod();
myInstance.myOtherMethod();
// ...

var result:TestResult = testSuite.getResult();
trace(result.toString());

The default layout is the MethodInvocationTreeLayout. This layout orders 
methods by the order in which they where invoked and by which method invoked 
which other method.

Greetings,
Simon
--
Simon Wacker
www.simonwacker.com
www.as2lib.org
www.hq-heilbronn.de
www.flik-flak.de

----- Original Message ----- 
From: "Johannes Nel" <johannes.nel at gmail.com>
To: "Open Source Flash Mailing List" <osflash at osflash.org>
Sent: Friday, June 03, 2005 11:20 PM
Subject: [osflash] profiler tool


hi all

i was wondering if anyone kows of a tool to profile swf's in detail.
MM must have one otherwise how would they optimize? anyone else have
one?

cheers
j
-- 
j:pn

_______________________________________________
osflash mailing list
osflash at osflash.org
http://osflash.org/mailman/listinfo/osflash_osflash.org





More information about the osflash mailing list