shPerformance (mem/fps/ms)

shPerformanceAn extremely light-weight and beautiful data broker addon that monitors system information and works right out of the box!

NOTE: I will not be updating or maintaining my secondary patch addon shMem. If you are interested in updating/maintaining it, send me a message.

Why use this addon instead of some of the other famous system monitors? Simple: elegance, ease of use, and efficiency. Other addons similar to shPerformance are extremely "busy" and highly inefficient when it comes to coding.

IMPORTANT: You must have a data broker display addon in order to enable this addon. I recommend Docking Station or you can find a list of other LDB display addons here. Changing the fonts of the tooltips is handled via a tooltip addon. I highly recommend using TipTac.

This addon displays and has the following options:

Frames per second (fps)

Latency (ms)(both HOME/local and WORLD ms)

Addon memory usage (mb or kb)

Option that allows sorting in two different ways: alphabetically or by descending memory usage

If you liked this mod, please check out my other addons:shClock: Data Broker simple clockshNameplates: Lightweight, simple, and sexy nameplates

6.2
-Updated TOC file and cleaned up some code
-----------------------
6.1
- Fixed latency to show WORLD latency
- Code clean up for deprecated items
-----------------------
6.0
- Code clean up of deprecated items and some basic spring cleaning
- Updated toc for legion
- Updated some global calls to Blizzard API regarding addons
- Fixed up tooltip to clean up colors and information
- Added config option to show both FPS and Latency in broker text as well as in tooltip
-----------------------
r5.1
- Code clean up of deprecated items
- Fixed OnUpdate/OnEnter event handlers to properly render tooltip in right place
-----------------------
r5.0
- Updated minor issue with getting addon list and putting into table to manipulate
- TOC Bump
-----------------------
r4.1
- TOC Bump
-----------------------
r4.0
- ToC bump: got it right this time and set to 50001
- Optimized code with a few new tricks!
------------------------
r3.0
- ToC bump -> 5.0
- Should be working fine for MoP
------------------------
r2.6b
- ToC bump -> 4.3
-------------------------
r2.6a
- ToC bump
-------------------------
r2.6
- TOC update to 4.1
- Minor improvement in OnUpdate function
--------------------------
r2.5
- More optimizations to code, specifically removed the redundant IsAddOnLoaded() function call
- ADDED: Local/Home ms to latency tooltip
- Changed how the latency LDB text was display to show XXms/XX(w) ms instead of the stupid hyphen
--------------------------
r2.4
- Big code clean up and localized a lot of code
- You gotta ask yourself in LUA, are you local ;) -> Thanks Treeston
---------------------------
r2.3
- Changed the latency db text to make it look better and clearly decipher between world and local ms
---------------------------
r2.2
- Cleaned up some code and reduced the coloring of unimportant tooltip items
- ADDED: latency for both HOME and WORLD server ms to show in real time on databroker
----------------------------
r2.1
- Cleaned up unused functions
- REMOVED formatMem2 function and integrated it into formatMem
-----------------------------
r2.0
- Cleaned up coding and added shMem LDB as a separate module
- ADDED code to see if shMem is loaded and if it is loaded, to only show memory detailed tooltip over shMem LDB instead of shPerformance LDB (MUST have both addons installed - as separate addon folders)
------------------------------
r1.1
- Small update to ToC file and removed the ##Version attribute
- Fixed up some function names so I can work on big update...
------------------------------
r1 - new updating system (newer than v8.1)
- REMOVED the shMem data broker completely (again, sigh I know). But it will run better this way with a lot less lag. If you really want to see your memory usage, just hover over and see the tooltip.
- ADDED line at bottom of tooltip to show how many addons are "hidden" (not above the memory threshold) and what the total amount of memory used for those addons.
- Optimized some more code
-------------------------------
v8.1
- ADDED the shMem broker back
- After lots of hours trying to find a work around for the jittering/fps decrease, I have figured out a way to decrease it by a lot. NOTE: for having an addon like this calls the UpdateAddOnMemoryUsage() function a lot, it's natural to have some cpu/memory usage. I minimized that by making the broker update slower than if you were hovered over it.
- Optimized lots of code with major rewrites
--------------------------------
v8.0
- MAJOR update: overhauled OnUpdate methods for LDB's (this was causing too many performance issues and jittering on lots of computers)
- REMOVED memory LDB and added all pertaining information to ONLY display on FPS broker
- Optimized some more code to fit the changes
- REMOVED "wantOnClickUpdating", thought the addon was getting too "busy" with too many options. Now the tooltip will ALWAYS update in real time and onclick. However, OnUpdate now doesn't call the UpdateAddOnMemoryUsage() and iterates over a table (saving a lot of CPU cycles). This will only happen by hovering over the LDB
- REMOVED option to show TOTAL UI memory in LDB (see above)
----------------------------------
v6.9
- Fixed minor error when using the coloring option and cleaned up initial addon table
-----------------------------------
v6.8
- Fixed color scheme to show coloring of addon names based on the ToC file or can use the coloring option
-----------------------------------
v6.7
- Optimized some small snippets of code
- Returned to wantonclickupdating = false default so the tooltip updates in real time (per popular demand)
-----------------------------------
v6.5
- Updated ToC for 4.0.1
------------------------------------
v6.3
- Fixed bug that was not allowing the fps and latency databroker objects to update correctly
------------------------------------
v6.2
- Minor update: reset a bunch of defaults to take less memory and fix the jittering that some people are having (just a temporary fix)
- Fixed some code to allow the broker object to keep updating every 2 seconds and not based on the UPDATEPERIOD variable
-------------------------------------
v6.1
- Removed second set of icons (no one wanted them)
- Updated code and added IsAddOnLoaded() function call to clean up and optimize
- Updated ToC file
--------------------------------------
v6.0
- Updated tooltip to make it display shPerformance addon memory usage by itself at the bottom!
- ADDED fps and latency display on tooltip itself for users who don't want to turn on the other databroker objects
- ADDED option to turn off coloring of the addon names (but the memory usage stays the same)
- Updated some function calls and minor cleanup of code
---------------------------------------
v5.1
- Updated TOC file
- Added another set of icons that can be changed via lua file (check for easy instructions)
- Fixed some small issues with formatting
---------------------------------------
v5.0
- Updated TOC a bit
- Due to popular demand, the default sorting method is back to alpha order
- Fixed the formatter to change 1000kb to 1.0mb (instead of < 1024)
----------------------------------------
v4.9
- Updated TOC finally
- Changed some redundant local variable calls and tried to clean up some code
- Changed default update time to every 1 second instead of 2 seconds
- Changed memory threshold back up to 60kb
-----------------------------------------

Originally posted by Shadowcall i had the same readings (20-28 kb usage)
i modified lines 107 and 117 from

Code:

if elapsed < UPDATEPERIOD then return end

to

Code:

if elapsed < (UPDATEPERIOD-3) then return end

now i can set UPDATEPERIOD to 5 s (it seems that if i set values from 1 to 3 stuttering start appearing, but i set to 5 to be sure it dosen't happen) and also have fps and latency updated at 2 s, or at least it seems this way to me

also it seems that stuttering starts only in crowded cities

hope you don't minde i did this little hack

will try my modification in a dungeon tonight, will post results after

p.s. some ppl will like the accurate FPS display , like me for example

l.e. no more problems

Sounds interesting, I am going to experiment with that. Thanks bud for the info and I might also just change the item for people that don't want to worry about so detailed information such as the FPS thing.

i had the same readings (20-28 kb usage)
i modified lines 107 and 117 from

Code:

if elapsed < UPDATEPERIOD then return end

to

Code:

if elapsed < (UPDATEPERIOD-3) then return end

now i can set UPDATEPERIOD to 5 s (it seems that if i set values from 1 to 3 stuttering start appearing, but i set to 5 to be sure it dosen't happen) and also have fps and latency updated at 2 s, or at least it seems this way to me

also it seems that stuttering starts only in crowded cities

hope you don't minde i did this little hack

will try my modification in a dungeon tonight, will post results after

p.s. some ppl will like the accurate FPS display , like me for example

Originally posted by Skylinee I saw you added decimals to the FPS display, any way to disable this? It just takes up more space and i don't find it important to have it tracked that perfectly.

Actually I was debating that myself...I'm going to change that in the next update. I just figured it was really accurate, but now that I think about it...do we really care about 56.3 fps instead of 56? lol

Originally posted by Skylinee I guess anyone with stuttering should run OptionHouse or some other form of profiling addon to see if they come up with the same numbers as me. Also they could post their config options to ease troubleshooting more.

I totally agree - IF YOU ARE experience any type of slow down or stuttering please give me more information and run addons like OptionHouse to give me CPU usage as well as mem usage.

I guess anyone with stuttering should run OptionHouse or some other form of profiling addon to see if they come up with the same numbers as me. Also they could post their config options to ease troubleshooting more.

Do you have any idea of how resource heavy this is? It's only using 0.4-1 CPU, and that's very very low. Not sure if it has a significant impact when running ~100+ addons though, as i'm ''only'' using 76.

That's what's baffling me. It isn't that bad CPU wise and the memory usage fluctuates ONLY when the tooltip is displays, it stick steady at around 20kb and never goes above 28kb. I have NO idea what could cause the stuttering other than the realtime updating when tooltip is up...but even then, I have never seen a problem on my machine. I will do some more research, but I am running out of ideas...let me know if you can think of anything.

Do you have any idea of how resource heavy this is? It's only using 0.4-1 CPU, and that's very very low. Not sure if it has a significant impact when running ~100+ addons though, as i'm ''only'' using 76.

Originally posted by Morgalm Why not just make the tooltip scrollable then all addons can be seen and you can just set a max tooltip size depending on screen size?

That's something to look into. We'll see what I can do.

@Shadowcall: I don't know what to tell ya bud, I can't optimize it anymore and I don't understand why you are having this problem. I have yet to have any problems at all on 4 different machines. It has to be another addon messing with mine. Keep me up to date on any developments and if someone wants to look at the code and give me pointers, I welcome that.

Originally posted by Morgalm Stuttering seemed a bit better with broker_cpu off but it was still noticeable. With broker_cpu if I turn on cpu profiling it basically behaves the same but if I just have mem profiling on it doesn't stutter at all. Does your's always have cpu profiling on? Also is there no option to sort the tooltip by mem usage?

I don't have any function or scripting to turn on CPU profiling so I couldn't imagine it being on at all. As far as sorting, if you go into LUA file you can find out that you can sort it in two different ways: alphabetically and by memory usage. Just change the "wantAlphaSorting" variable to false.

Stuttering seemed a bit better with broker_cpu off but it was still noticeable. With broker_cpu if I turn on cpu profiling it basically behaves the same but if I just have mem profiling on it doesn't stutter at all. Does your's always have cpu profiling on? Also is there no option to sort the tooltip by mem usage?