No description
Find a file
2023-09-24 21:08:54 +02:00
example-empty initial commit 2020-05-17 11:09:47 +02:00
example-slowFastRendering uncrustify 2023-09-24 21:08:54 +02:00
src uncrustify 2023-09-24 21:08:54 +02:00
.appveyor.yml initial commit 2020-05-17 11:09:47 +02:00
.gitignore initial commit 2020-05-17 11:09:47 +02:00
.travis.yml initial commit 2020-05-17 11:09:47 +02:00
addon_config.mk initial commit 2020-05-17 11:09:47 +02:00
ofxaddons_thumbnail.png Add thumbnail 2020-05-21 13:14:14 +02:00
README.md Add thumbnail 2020-05-21 13:14:14 +02:00

ofxProfile

thumbnail

OpenFrameworks addon for simple and quick thread safe profiling. Then throw the result in chrome://tracing

This addon is practically cut and paste from https://github.com/TheCherno/Hazel/blob/master/Hazel/src/Hazel/Debug/Instrumentor.h

Usage

add ofxProfiler to your application with projectGenerator (or whatever method you prefer)

ofApp.h

// uncommment to profile
// #define OFX_PROFILER 1

#include "ofxProfiler.h"

// ... bla bla bla

ofApp.cpp

//--------------------------------------------------------------
void ofApp::setup() {
    OFX_PROFILER_BEGIN_SESSION("a test","result.json");
    OFX_PROFILER_FUNCTION();

    
} // end of scope => profile function ends

//--------------------------------------------------------------
void ofApp::update() {
    OFX_PROFILER_FUNCTION();

    {
        OFX_PROFILER_SCOPE("scope 1");
    }

    {
        OFX_PROFILER_SCOPE("scope 2");
    }
}

//--------------------------------------------------------------
void ofApp::exit() {
    OFX_PROFILER_END_SESSION();
}

when closing the application, you will find a result.json next to the binary open that with chrome://tracing