New profiler interface

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

New profiler interface

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: New profiler interface

Post 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...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: New profiler interface

Post by CuteAlien »

And another version checked in. Windows works now as well.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: New profiler interface

Post 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
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: New profiler interface

Post by CuteAlien »

OK, this interface is about CPU profiling (it's what I needed ^_^).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply