Author Topic: Axe Diagnostic Tool  (Read 2922 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Axe Diagnostic Tool
« on: November 16, 2012, 07:19:51 pm »
Axe Diagnostic Tool

The Axe Program Diagnostics Tool is an Axe utility that allows you to run diagnostics on the runtime speed of your program, analyzing relative and absolute speeds of various subroutines.  The utility works by setting up an interrupt that periodically samples your program to see in which routines it is spending the most amount of time.  It also traverses the stack during each call to give you even more information.For example, is your game running slow?  Can't figure out which part is slowing it down the most?  Set up the Axe Program Diagnostics Tool to track all of your major subroutines, and it will tell you how long your program is spending in each routine.  If you need higher fidelity, you can also place additional labels inside of a single subroutine to see which parts are taking the most amount of time.

       The screenshot below gives a good example how this program works, and specifically the difference between inclusive and exclusive samples.  A label gets an inclusive sample every time it's own code is sampled, and a label gets an exclusive sample any time it has it's own code, or the code of any routine it has called, sampled.  Below, there are 4 labels, MAIN L1 L2 and L3.  MAIN is just the main loop that calls L1 and L2.  L1 displays a sprite, L2 pauses and then calls L3, and L3 just pauses.

   When we look at the inclusive percent, we can see that MAIN has very little, since it is barely doing anything (just calling 2 subroutines and looping).  L1 has practically zero percent, because the only thing it does is call another subroutine (to draw a sprite) which is not counted in the inclusive percent.  Both L2 and L3 are about the same, they both have inclusive samples proportional to the amount of work they do.  The 'Other' label has 11 percent, which accounts for the time spent displaying the sprite. But when we look at exclusive percent, things get a little bit more interesting.  The percent for MAIN is 100%, since all code that is ever executed is either in MAIN, or inside of a function MAIN calls.  L1 now has the same percent as 'Other' since L1 itself barely contributes and gets all it's percent from the sprite routine it calls.  L2 has increased since it calls L3.  'Other' always remains the same between Inclusive and Exclusive.
« Last Edit: August 20, 2022, 12:04:14 am by Eeems »

Offline Vijfhoek

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 120
  • Rating: +13/-1
    • View Profile
Re: Axe Diagnostic Tool
« Reply #1 on: November 16, 2012, 07:21:05 pm »
Cool, might come in handy for me someday!