Page 1 of 1

New profiler interface

Posted: Thu Apr 24, 2014 11:03 pm
by CuteAlien
I just checked in a new interface which can be used to add stop-watch like profiling to the code.
Comes with a gui-element (which could still use some improvement, but works basically) and an example how to use it (new example 30).

Note - I haven't created VS project files yet for the example (will do) and MacOSX build will break at the moment (just needs the new files, have to wait until someone with Mac does this).

When you rebuild Irrlicht with _IRR_COMPILE_WITH_PROFILING_ enabled in IrrCompileConfig.h you can also get some profiling data about engine internals. Proposals about where to add some more of them are welcome.

A short description about the design:
The idea is that you add start/stop blocks in the code you want to profile. Preferably with a define-wrapper around it so it can be disabled easily. The whole design is about making this start/stop stuff really fast. There's some comfort functions like scope-profiling which can be done with a single line.

It got added in 4791 to svn trunk: https://sourceforge.net/p/irrlicht/code/4791/

Any feedback about the interface is welcome.

Re: New profiler interface

Posted: Fri Apr 25, 2014 12:25 am
by CuteAlien
Omg, I should probably have developed on Windows as that's always the harder one when it comes to export troubles. Sorry - current Interface won't work on Windows. Either I have to inline everything in my CProfiler and SProfileData classes (don't like that), or have to work with IRRLICHT_API which then means I can't use the template classes like core::stringw and core::array easy (probably would have to use pointers to them - don't like that...) or I have to give up on avoiding an IProfiler interface and just life with the overhead of virtual functions (don't like that...).

Thinking...

Re: New profiler interface

Posted: Fri Apr 25, 2014 1:20 pm
by CuteAlien
And another version checked in. Windows works now as well.

Re: New profiler interface

Posted: Sun Apr 27, 2014 1:36 pm
by devsh
new version of BuildAWorld irrlicht will have OpenGL timers included as a separate utility class

we measure (although by introducing stalls :( , will do round robin circular buffer timers in the future) the times it takes the actual GPU to do the work, so i.e we know that my HDR takes 1.2ms on a mobile AMD Radeon

Re: New profiler interface

Posted: Mon Apr 28, 2014 10:15 am
by CuteAlien
OK, this interface is about CPU profiling (it's what I needed ^_^).