Ghost.b88 Posted January 21, 2011 Report Share Posted January 21, 2011 What profiler does the game currently use?And how is it getting the resolution of the measurements down to usecs? Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted January 21, 2011 Report Share Posted January 21, 2011 The in-game profiler (press F11 to toggle, then press numbers to drill down) is in ps/Profile.cpp and ProfileViewer.cpp, originally based on "Real-Time Hierarchical Profiling" from GPG3.For much-lower-overhead in-game measurement there's also some macros in lib/timer.h - look for its comments on TIMER and TIMER_ACCRUE, which measure a block and dump the timings into Visual Studio's debug output window (on Windows) or stdout (on Linux/OS X).The timer implementation depends on OS - see lib/timer.cpp, which usually uses clock_gettime on non-Windows platforms and uses lib/sysdep/os/win/whrt/ on Windows. whrt picks one of many timers depending on what's considered accurate and safe. (docs/timing_pitfalls.pdf documents the rationale.)For more detailed profiling I usually use Valgrind's callgrind tool on Linux with KCachegrind, since it's nice and precise (it counts every instruction) and consistent, though not entirely representative of real low-level performance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.