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

  • Your Rating

  • Share
  • Report Abuse

KLHPerformanceMonitor

 
Project Updated:
Files Updated: Wed, Oct 29 2008
Supports Game Version: 3.0.2
Category: Unit Frames
Tags:

, , , , , and [Edit Tags]

Project Manager: Kenco
Additional Authors: No additional authors
Current Version: 302 compat
License: All Rights Reserved
Development Site: CurseForge
Avg Daily DL (last 30 days): 5
Downloads Total: 26,544
Favorites: 212
Comments: 49
  • About KLHPerformanceMonitor
  •  

KLHPerformanceMonitor

KLHPerformanceMonitor (KPM) is an addon that profiles other addons. That is, it tells you how much proccessor time and garbage memory each of your addons are using. Garbage refers to table memory (heap allocated) that is no longer referenced, becoming unused and hence "garbage".

KPM is idle when you login and has to be activated before it will start collecting data. To activate KPM, run the command

/kpm start

Depending on the number of active Frames loaded, KPM may take a while to load. However, KPM is designed to fragment the loading operation so as not to interrupt the user while it is loading. The loading status is indicated by a progress bar and message in a small window in the center of your screen.

Once KPM is active, you can view the accumulated data by running the command

/kpm data

A window is shown with a list of the Addons that are being monitored. Click on one of the items in the list to view the details of that Addon. KPM shows the processor usage in milliseconds and the garbage creation in Kilobytes. Each item is split into three categories, "Updates", "Events", and "Total". "Updates" refers to methods that run periodically. "Events" refers to methods that run in response to system events.


Why should I use KLHPerformanceMonitor over Blizzard's CPU Profiling?

The main reason is for performance reasons. Blizzard's CPU Profiling tries to do too much and as a result has a large performance impact on your system. Because it tracks the time taken to call every single function, including common functions like string.* and math.*, Blizzard profiling decreases your fps noticably. On the other hand, KPM attaches to critical insertion points only. In this way it tracks the information you are interested in - Addon-wide processor and memory values - while having a negligable effect on overall system performance.

In addition, Blizzard Profiling can't be turned off without restarting Wow.exe. KPM starts idle unlses it is activated by the user.


The second reason is that KPM data is more representative of real Addon performance. Because Blizzard profiling is attached so deeply into the LUA system, it can cause massive performance distortions. Individual addons may run 5 to 10 times slower depending on their architecture.

On the other hand, KPM has a relatively light hook on the system. This means that the numbers reported by KPM are an accurate reflection of your addon performance without the profiling overhead.


Lastly, KPM gives you access to data that the Blizzard Profiler can't - garbage creation. While the garbage collection of the LUA environment has improved greatly, if an addon is creating excessive garbage it will result in amortised processor time that is not attributed to that addon. KPM reveals these trouble-causing addons to help fine-tune your system.


What's New (since the old version of KPM)?

1) The previous version of KPM was designed before WoW 2.0, and given only a dodgy hack job when 2.0 came in. As a result the old version could cause tainting, which causes core addon functions to stop working. The new version has a foolproof method of identifying Blizzard frames, therefore it won't hook protected functions and cause problems.

2) The new version has a greatly improved frame identification technique. Previously KPM grouped frames by their name, but it could be empty in which case KPM had trouble identifying it. New technology allows KPM to work out the name of the Addon that owns every frame, giving perfect identification.

3) The new version comes with a point and click graphical interface to display the information in a more helpful manner.

4) The new version of KPM separates OnUpdate and OnEvent data into separate groups.

  • Downloads (4)
  •  
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  
  KLHPerformanceMonitor 302 compat Release 3.0.2 2,466 10/29/2008
  KLHPerformanceMonitor 5.2 (bugfix) Release 2.1.3 198 8/20/2007
  KLHPerformanceMonitor 5.1 Profiling Blizzard Code! Release 2.0.0 123 7/7/2007
  KLHPerformanceMonitor KPM 4.3 (stability fixes) Release 2.1.2 124 6/27/2007
  • 1 page(s)
  • 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.
  • Kharthus said

    TOC is out of date on the new version.

    Reply Report Permalink
  • Kenco said

    tayedaen,
    well noticed and explained! Fix inc!

    Reply Report Permalink
  • tayedaen said

    Hi Kenco!

    I had a bug in 5.1: Date: 2007-08-12 12:58:31 ID: 51 Error occured in: Global Count: 1 Message: ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua line 367:

     bad argument #1 to 'len' (string expected, got nil) 

    Debug:

     (tail call): ? [C]: ? [C]: len() ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:367: getframenameheader() ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:348: getframesourcename() ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:131: processframe() ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:118: load() ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:87: method() ...KLHPerformanceMonitor2\Code\Services\KPM_Console.lua:829: value() ..\FrameXML\ChatFrame.lua:3406: ChatEdit_ParseText() ..\FrameXML\ChatFrame.lua:3098: ChatEdit_SendText() ..\FrameXML\ChatFrame.lua:3119: ChatEdit_OnEnterPressed() [string "*:OnEnterPressed"]:1: [string "*:OnEnterPressed"]:1 

    I did some debuggin: the fault lies in line 363, where you declare name as local. But then it's nil outside of the IF-structure ;-)

    Old Code: if name == nil then

    local _, name = string.match(dump, "@(.-)([%w_]+)")

    end

    New code: if name == nil then

    _, name = string.match(dump, "@(.-)([%w_]+)")

    end

    Reply Report Permalink
  • Kenco said

    Acapela,
    That's by design. All the new frames you see are from Blizzard Addons. In particular BuffFrame, MultiBar, UIParent, SecureStateDriver are blizzard made and can't be profiled outside of 5.1.

    Reply Report Permalink
  • acapela said

    FYI, v5.1 "blizzard profiling code" is generating cryptic frame/addon names for me... i have returned to using 4.3, which identifies the addon culprit.

    thanks.

    Reply Report Permalink
  • Hi - keen to understand the overheads my addons takeup and prune if necessary...so this mod looks neat. Couple of questions if I may:

    1. Can I start this up and use the data to understand my current usage...then once I've decided which addons to keep , switch it off ? - or do I need to keep it running.

    2. Assuming the answer to 1 is Yes, do I need the Blizzard CPU Profielr running either or can I shut if off using the script you posted below.

    Cheers n Beers

    Bones

    Reply Report Permalink
  • Kenco said

    I'm proud to announce new functionality that will profile all blizzard code and secure frames!

    There's a small kink in the code, that all the excess processor time goes to WorldFrame, but apart from that it looks good. I'm still thinking of ways to group up all the blizzard frames cause there's quite a few of them all up, but it's pretty good.

    I guarantee anyone using the blizzard extended action bars will be shocked and amazed!

    Reply Report Permalink
  • Kenco said

    Kolakhan, this asks whether it is on:
    /script ChatFrame1.AddMessage(tostring(GetCVar("scriptProfile") ~= nil))

    this turns it off:
    /script SetCVar("script Profile", nil)

    Reply Report Permalink
  • Kolakhan said

    How do I know if the Blizzard Profling is running or not?

    Reply Report Permalink
  • Kenco said

    added 4.3: 4.3

    - fixed saved variables printout

    - fixed potential lua error on start

    - fixed non-enUS problem


    also clarified /kpm2 in description.

    Reply Report Permalink
  • Sheepydaz said

    Hey, im getting this when i try to use the start command

    Error: unable to dump given function AddOn: KLHPerformanceMonitor2 File: KPM_Main.lua Line: 212 Count: 1

    Reply Report Permalink
  • oXid_FoX said

    > Dabeuliou (funny nick), try the following command : /kpm2 start

    essaie la commande : /kpm2 start


    > Kenco, please update your post to correct this...

    how to close the window opened by /kpm2 data ??

    and can this window be dragable ? thank you !

    Reply Report Permalink
  • Dabeuliou said

    Does this addon work on french versions? When I run the game with KPM, I have this error message:

    ...formanceMonitor2\Code\Framework\KPM_localization.lua:112:attempt to index local 'localtree' (a nil value)

    And I can't even use a /kpm command.

    Thank you!

    Reply Report Permalink
  • Kenco said

    ChWolfgang, That's an interesting error. That usually happens when you try a system function which i wouldn't expect to be found in an onupdate or onevent handler. I can post a fix for that but i'm very interested in what addon would cause it.

    Reply Report Permalink
  • ChWolfgang said

    Greetings,

    Thanks for working on this mod. I think it will be very useful. At this point, (4.2) when is use /kpm2 start I get: Error: unable to dump given function AddOn: KLHPerformanceMonitor2 File: KPM_Main.lua Line: 212

    Tried a few time.

    FYI, the instructions above don't say KPM2 start just /kpm start. Had to read the comments to find it.

    Thanks again! Amron -Uther-

    Reply Report Permalink
  • Kenco said

    fly, epicpriest:

    fixed your issue in the new version. Please tell me how whether the numbers reported in the "#UNKNOWN" category are significant, if they are i'll try to work it out better.

    Full changelog: 4.2

    - Added buttons to sort the list by memory and time

    - added a close button to the window

    - better formatting of numbers

    - put in a dodgy fix for errors from bad frames. Depending on how prevalent the problem is i'll put more work into it.

    Reply Report Permalink
  • Kenco said

    flyg, epicpriest Hoped that wouldn't happen, but alas. I'll put up a fix for that, but it may mean there's an "unknown" section for frames that can't be categorised.

    Rikakiah, If you don't know how to turn if off, chances are it's not on then, because it's not on by default. anyway, the command is /script SetCVar("scriptProfile", 0) then you have to reload UI.

    8tImER, Read the description section, thanks.

    Reply Report Permalink
  • Gnarfoz said

    What? :D

    Blizzard's profiler does its work on the C side of things, yours on the Lua side. How can yours be more accurate o_O

    Reply Report Permalink
  • Rikakiah said

    Since I couldn't find it on the Blizzard forums or patch notes (I remember seeing the command in the original patch notes when it updated, I thought, though...), I'll ask here since it seems you obviously know: How do I disable Blizzards internal performance meter? Thanks.

    Reply Report Permalink
  • flyg said

    I type in /kpm2 start and immediately get the following message :

    ...face\AddOns\KLHPerformanceMonitor2\Code\KPM_Main.lua:238:Usage:issecurevariable[table,] "variable")

    Reply Report Permalink
  • Addon Packs Containing KLHPerformanceMonitor

Most Downloads / Day

KLHPerformanceMonitor has not been added to any Addon Packs yet.

  • Similar Addons
  •  

Average downloads per day

  1. 11,397 HealBot Continued Unit Frames, Buffs & Debuffs...
  2. 2,530 X-Perl UnitFrames Raid Frames, and Unit Frames
  3. 1,800 Grid Unit Frames
  4. 1,699 GridStatusRaidDebuff Unit Frames
  5. 1,389 VuhDo Buffs & Debuffs, Druid, Healer...