Skip to content
Oliver Xu edited this page Dec 16, 2017 · 5 revisions

Your app is running slow or allocates ton's on memory, well it's time to profile it!

HTML5 target

Chrome

You can use chrome's developer tools to profile your application

Native targets (C++)

hxScout

Setup

Make sure port 7934 is open and unused (f.ex. you can't run both Scout and hxScout next to each other).

Application setup

Install the https://github.com/jcward/hxtelemetry library

haxelib install hxtelemetry

Edit your khafile.js to include hxtelemetry.

project.addLibrary('hxtelemetry');
project.addCDefine('HXCPP_TELEMETRY');
project.addCDefine('HXCPP_STACK_TRACE');

And edit your application's sourcecode to initialize hxtelemetry.

class Main {
    static var hxt = new hxtelemetry.HxTelemetry();
    
    public static function main() {
        kha.System.init(..., system_initializedHandler);
    }
    
    static function system_initializedHandler() {
        kha.Scheduler.addFrameTask(hxt.advance_frame.bind(null), 0);
    }
}

Profiling and further reading

Start hxScout, then start your application and have fun! Documentation on how to use hxScout is available on the net:

Flash target

Adobe Scout

Setup

Make sure port 7934 is open and unused. For basic instrumentation (Framerate, cpu usage, ...) no further setup is required. For more advanced instrumentation (Memory (de)allocation, Stage3d captures) edit your khafile.js.

project.addDefine('advanced-telemetry');

Profiling and further reading

Just start Scout, then start your swf and have fun! Documentation on how to use scout is available on the net:

Clone this wiki locally