• World of Warcraft Addons
  • World of Warcraft
  • Average Rating:

  • Your Rating

  • Share
  • Report Abuse

FunctionProfiler

 
Project Updated:
Files Updated: Thu, Apr 16 2009
Supports Game Version: 3.1.0
Category: Development Tools
Tags:

[Edit Tags]

Project Manager: smariot
Additional Authors: No additional authors
Current Version: 1.1
License: GNU General Public License version 3 (GPLv3)
Development Site: CurseForge
Avg Daily DL (last 30 days): 1
Downloads Total: 545
Favorites: 5
Comments: 2
  • About FunctionProfiler
  •  

An AddOn for displaying the time spent inside functions, to help find bottle necks in code. For developers only.

This AddOn is used exclusively through slash commands.

Enabling/Disabling CPU Profiling

  • /fp e
    Enable CPU Profiling.
    This uses extra CPU cycles, even when the AddOn isn't running, so be sure to turn it off when you're done. This will cause the user interface to be reloaded.
  • /fp d
    Disable CPU Profiling.
    This will cause the user interface to be reloaded.

Adding/Removing Watches

By default, FunctionProfiler watches _G.

  • /fp a [function | table]
    Add a watch for a function or table.
    Tables and their metatables are recursively checked for functions, and all found functions are added.
  • /fp l
    Lists all watched functions or tables.
  • /fp r [function | table]
    Removes a watched function or table.
  • /fp rs
    Rescans watched tables, useful if what you wanted to watch didn't exist when the AddOn was loaded.
  • /fp f pattern
    Filters watched functions using a Lua pattern.

The above slash commands can of course only watch things that are globally visible. This AddOn creates two global functions which you can call from inside your AddOn to watch local variables.

  • AddFunctionWatch([function | table], name)
    Watches a function or table. name is used for display purposes.
  • RemoveFunctionWatch([function | table])
    Removes a watch previously added by AddFunctionWatch().

The Graph Window

  • /fp s
    Shows the graph window.
  • /fp h
    Hides the graph window.

The graph window can be dragged around using the left mouse button. The mouse wheel will increase or decrease the number of objects displayed. Right clicking changes how the items are sorted.

  • Exclusive Time
    Sort by the total time spent inside a function, not counting time spent in functions that it called.
  • Inclusive Time
    Sort by the total time spent inside a function, including time spent inside functions that it in turn called.
  • Inclusive Time Per Call
    Sort by the average total time spent inside a single call to a function, including the time spent in functions that it in turn called.
  • Exclusive Time Per Call
    Sort by the average time spent inside a single call to a function, not counting time spent in functions that it called.

When displaying inclusive calls, the bright part is the time spent inside the function in question, the dark part is time spent in functions that it called.

When a function can be seen from multiple locations, the one that would result in the shortest name is displayed.

Known Bugs

The time between when a co-routine yields and when it is resumed counts towards the execution time of the function that yielded.

The code that searches for functions tries to find the shortest function name; if your filter is applied to a table that was found under multiple names, and a shorter name was discovered that didn't match the pattern first, any longer names, even if they do match, will be filtered anyway. I expect filtering works properly in most cases, and that the effort of checking every possible permutation isn't worth it.

  • Downloads (2)
  •  
File Name Release Type Game Version Downloads Date
Addon Curse.com Beta 2.3.3 0 9/29/2008
  File Name Release Type Game Version Downloads Date  
  FunctionProfiler 1.1 Release 3.1.0 358 4/16/2009
  FunctionProfiler 1.0 Release 3.0.3 187 12/19/2008
  • 1 page(s)
  • Screenshots (1)
  •  
  • Comments

Add Comment  

Add

You need to login or register to post.

Benefits of Registration

  • Interact with hundreds of thousands of other gamers on an open social network.
  • Post your stories, news, images, videos, and other content to share.
  • Create a network with your fellow gamers or join an existing one.
  • Gain reputation for everything you do.
  • Hi Smariot,
    thanks for this great addon. This is what I was looking for for a long time. Adding/removing a large number of functions via command line is a bit annoying though (Bigger projects tend to have many hundred functions).

    Here's a walkaround if you want to see the functions of your own addon only (Assuming they all start with your addons name, in this example it is "VUHDO")

    local tempData, tempFName;
    table.wipe(FunctionProfiler_Settings["watched"]);
    for tempFName, tempData in pairs(_G) do
    if (strsub(tempFName, 1, 5) == "VUHDO") then
    if (type(tempData) == "function") then
    table.insert(FunctionProfiler_Settings["watched"], tempFName);
    end
    end
    end


    type /console reloadui
    type /fp rs

    ...and you are done.

    Cheers,
    Iza

    Reply Report Permalink
  • smariot said

    I just added a filter command to the AddOn, you should be able to accomplish the above by typing:

    /fp f ^VUHDO

    Reply Report Permalink
  • Wow, I didn't know you're still reading this. So I'm really sorry, for the much too late reply (> half a year. Just wanted to say: Thank you very much!

    Reply Report Permalink
  • MeisBarry said

    Great tool. Thanks a bunch.

    Reply Report Permalink
  • 1 page(s)
  • Addon Packs Containing FunctionProfiler

Most Downloads / Day

FunctionProfiler has not been added to any Addon Packs yet.

  • Similar Addons
  •  

Average downloads per day

  1. 437 Addon Control Panel Libraries, Development Tools...
  2. 345 !BugGrabber Development Tools
  3. 136 BugSack Development Tools
  4. 28 LibOOP Libraries, and Development...
  5. 22 MpqViewer Data Export, and Development...