Measuring KLH Threat Meter’s impact on system performance
View blog reactions Written on June 15, 2007 by Chris Heald
Script used:
Download it in AddOn form at http://wow.tachyonsix.com/GhettoFPSMonitor.zip
FPSProfiler = CreateFrame("Frame", "FPSProfiler", UIParent)
local runTime = 0
local fpsSum = 0
local fpsTicks = 0
local startTime = 0
local timeToRun = 0
local profilerLock = false
local function print(msg, ...)
DEFAULT_CHAT_FRAME:AddMessage(string.format("|cffffcc00GhettoFPSProfiler:|r " .. msg, ...))
end
local function report()
local endTime = GetTime()
print("Profiling finished!")
print("Total run time: %s", runTime)
print("Total run time [GetTime() method]: %s", endTime - startTime)
print("Total frames: %s", fpsTicks)
print("Average framerate: %s", fpsSum / fpsTicks)
profilerLock = false
FPSProfiler:SetScript("OnUpdate", nil)
end
-- Runtime of doProfiling is O(n)
local function doProfiling()
runTime = runTime + arg1
fpsTicks = fpsTicks + 1
fpsSum = fpsSum + GetFramerate()
if runTime > timeToRun then
report()
end
end
FPSProfiler.Start = function(runFor)
if profilerLock then
print("Profiling, can't start another profile.")
return
end
profilerLock = true
timeToRun = runFor
runTime = 0
fpsSum = 0
fpsTicks = 0
if _G.klhtm then
print("Starting profiling, running for %s seconds, KTM is |cff00ff00enabled|r", runFor)
else
print("Starting profiling, running for %s seconds, KTM is |cffff0000not enabled|r", runFor)
end
startTime = GetTime()
FPSProfiler:SetScript("OnUpdate", doProfiling)
end
System Specs:
- Athlon X2 3800+ Dual Core, 2.01GHz
- 2.0 GB DDR3200 RAM
- BFGTech NVidia Geforce 7600GT, nv4_disp.dll driver: 6.14.0010.9371 (English)
- Windows XP SP2, build 2600
- AMD Cool ‘n Quiet driver not installed, Cool ‘n Quiet not enabled in the BIOS.
Process list:
- calc.exe
- taskmgr.exe
- wmiprvse.exe
- WoW.exe
- TSVNCache.exe
- Photoshop.exe
- notepad++.exe
- winamp.exe
- firefox.exe
- gain.exe
- avnotify.exe
- wuauclt.exe
- svchost.exe
- wscntfy.exe
- cftmon.exe
- jusched.exe
- svnhost.exe
- nvsvc32.exe
- btwdins.exe
- avguard.exe
- sched.exe
- spoolsv.exe
- explorer.exe
- avgnt.exe
- lsass.exe
- services.exe
- winlogon.exe
- csrss.exe
- smss.exe
- alt.exe
WoW Settings:
- Resolution: 1680×1050 (Wide), Windowed Fullscreen, running at 1920×1200 native resolution
- 60hz refresh
- 24 bit color, 24 bit depth 2x multisample
- Terrain distance: 60%
- Environment detail: 50%
- Anisotropic filtering: 0%
- Terrain texture: 100%
- Texture detail: 100%
- Character Shadows: on
- Spell Detail level: 100%
- Weather Intensity: on
- Level of Detail: off
- All shaders checked
- Trilinear filtering: off
- Vertical sync: off
- Triple buffering: off
- Cinematic subtitles: off
- Hardware cursor: on
- Smooth mouse: off
- CPU Profiling: Off
Location: Azure Watch
Addons running:
- GhettoFPSMonitor
- KLHThreatMeter v 19.18 (for test 2)
Testing methodlogy
Game was loaded. A UI reload was invoked, and the UI was given at least 20 seconds to fully load and get all work out of the way and to enter an idle state. The profiler was invoked, and I physically got up from the computer and walked away to ensure that there would be no input that would incur additional overhead processing costs. There was additional rendering cost as players ran past my view, but they occurred in both tests.
This ensured that the tests occurred on a stripped-down, bare-bones, otherwise idle system with as many variables as possible held constant.
15 sec run time:
/script FPSProfiler.Start(15)
No KTM
- Run 1: 42.01
- Run 2: 41.46
- Run 3: 40.90
- Run 4: 40.57
Average: 41.24 FPS
KTM
- Run 1: 40.23
- Run 2: 39.67
- Run 3: 37.68
- Run 4: 37.82
Average: 38.85 FPS
Conclusion: Over a 15 second period, KTM degraded my overall system performance by 5.8%
120 sec run time:
/script FPSProfiler.Start(120)
No KTM
Run 1: 41.47
KTM Run 1: 39.23
Conclusion: Over a 120 second period, KTM degraded my overall system performance by 5.5%
Final notes
10 tests is hardly conclusive (the one test each of the 120 sec cases is particularly incomplete), but I did it on a very short time budget, so more profiling may be done at a later date. I’ve included my entire setup here for anyone to replicate at will, and I am confident that it will produce similar results.
Edit: For grins and giggles, I went ahead and profiled Omen and ThreatLib under the same conditions.
Stock, 3 tests, 15 sec
- 41.759 + 41.55 + 40.91 = 41.40
Omem, 3 tests, 15 sec
- 42.22 + 40.92 + 40.44 = 41.19
Result: System performance while idle was reduced by 0.51% with Omen and ThreatLib versus a stock system, which is likely easily explained by the margin of error resulting from the low number of tests. I took screenshots, but I’m feeling lazy and anyone can replicate the tests as they see fit.
Posted in 
June 19th, 2007 at 8:07 pm
It’s a known fact that KTM is “always on” and therefore uses cpu all the time. Now, do the same test looking into a wall while 39 people are nuking Onyxia and you’ll see that ThreatLib eats way more. On my system albeit a little slower (1.8 Ghz, 256 MB VRAM) KTM slows down about 7-8% in raid battle, and Omen/ThreatLib slows 11-14% and above all, has more spikes in CPU usage which is severely annoying for a healer.
June 20th, 2007 at 3:23 am
I haven’t done extensive profiling of Threat in combat yet, but are you sure that it’s ThreatLib that’s consuming that memory, rather than Omen? Omen does a lot of fancy graphical stuff - very fast TPS updates, bar animations, etc - that can consume a decent chunk of CPU. They are toggleable for that reason, though - so that people that prefer resource efficiency over aesthetics have that option.
If you have any benchmark data, though, I’d love to see it - naturally, I don’t have a very wide array of systems to test my code on personally, so benchmarking data that others can provide would be most appreciated!
June 21st, 2007 at 3:39 pm
For what it’s worth, I ran Omen and KTM both with CPU profiling on for Gruul last night, and found that Omen and KTM barely registered on the profiler. Omen was significantly higher than Threat, due to the CPU time spent on GUI updates, but was still several orders of magnitude cheaper than KTM. Threat itself had a hard time staying in the top 20 for CPU time used.