Thread Tools Display Modes
11-05-10, 04:16 PM   #1
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
What defines a "lightweight" addon

Recently I've been going through and making my UI as "lightweight" as possible. I started off primarily focusing on memory usage (not really a good thing to judge lightweightness by) and gradually shifted to taking CPU usage into account.

I've seen pretty amazing results in terms of playability inside raids (moderate FPS increases and noticeably less interface lag), but a nagging question keeps popping up in my head.

I've looked at tons of mods that state they are lightweight in their description and most are (some more than others). The ones I've noticed that used the least amount of resources are the ones that are configured through lua instead of an ingame config, but now that my UI is what I deem "lightweight" I've sort of lost a guide to measure what is actually efficient or not.

So I've got two questions:
#1: How much memory usage is to much? I've set my view distance up higher in the config file before and noticed the game crashing due to out of memory errors, obviously due to the game having to render more terrain than normal (I'm assuming). At what addon memory usage level does game stability start becoming an issue? Currently my normal UI is using ~780kb of memory and I'm sitting right around 3MB while in raids. Obviously my memory usage isn't an issue but I'd like to hear what some authors think is "too high".

#2: What exactly is CPU usage telling us and what is the number of CPU/sec used per addon that starts to get into the realm of inefficiency? As a reference, typically speaking sitting idle (not the best judge either), my highest usage addon is using ~0.16 CPU/sec with my total UI using ~0.7 CPU/sec (0.15 of that is option house totrack the data). What are some of the values that some of the notoriously inefficient addons giving?
  Reply With Quote
11-05-10, 04:29 PM   #2
Petrah
A Pyroguard Emberseer
 
Petrah's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2008
Posts: 2,988
Addon Memory Usage


Posted by Cogwheel, one of the authors of World of Warcraft Programming(First Edition):
Unless you are an addon developer, you generally don't need to concern yourself with addon memory usage. In and of itself, memory use says absolutely nothing about how an addon impacts WoW's performance. WoW itself uses an order of magnitude or more RAM than even the most memory-intensive UIs.

Data mods like Auctioneer will always show HUGE numbers compared to other addons but they don't do any processing whatsoever unless you're actively using them (scanning the AH). By the same token, many memory-efficient mods can use up an extraordinary amount of CPU time (damage/threat meters, for instance).

As a user, you should never judge an addon's worth by the amount of memory it uses. For a real test, use CPU profiling which is also included in PerformanceFu. Another mod I like for this purpose is AddonManager.


the message is too short blah blah blah
__________________
♪~ ( ) I My Sonos!
AddOn Authors: If your addon spams the chat box with "Addon v8.3.4.5.3 now loaded!", please add an option to disable it!
  Reply With Quote
11-05-10, 04:37 PM   #3
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
A lot of people (guilty myself) tend to judge by memory usage because it's the only thing easily visible ingame. A lot of minimalistic UIs throw functionality overboard and look at memory only, not taking CPU into account. I used to do that but then I started to think a little and now I just balance a good functionality to performance ratio.

Static memory does almost nothing for addons, apart from affecting load times (though this is mostly caused by CPU usage during load as well).
  Reply With Quote
11-05-10, 04:39 PM   #4
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
#1: How much memory usage is to much? I've set my view distance up higher in the config file before and noticed the game crashing due to out of memory errors, obviously due to the game having to render more terrain than normal (I'm assuming). At what addon memory usage level does game stability start becoming an issue? Currently my normal UI is using ~780kb of memory and I'm sitting right around 3MB while in raids. Obviously my memory usage isn't an issue but I'd like to hear what some authors think is "too high".
70-100mb is too high.

#2: What exactly is CPU usage telling us and what is the number of CPU/sec used per addon that starts to get into the realm of inefficiency? As a reference, typically speaking sitting idle (not the best judge either), my highest usage addon is using ~0.16 CPU/sec with my total UI using ~0.7 CPU/sec (0.15 of that is option house totrack the data). What are some of the values that some of the notoriously inefficient addons giving?
Well it's probably not telling us anything, only allows to compare addons.
CPU Usage kings:
1) Raid frames
2) Action Bar range check
3) Damage meters
Can't think of any other addon category that impacts cpu usage, Boss mods/Threat meters maybe.

Last edited by d87 : 11-05-10 at 04:45 PM.
  Reply With Quote
11-05-10, 04:39 PM   #5
Gandoch
A Wyrmkin Dreamwalker
 
Gandoch's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 50
As far as I'm concerned, lightweight just means it does the same thing as something else with less memory/CPU usage. Using panel addons as an example, drawing a frame is a pretty simple thing to do. Drawing lots of frames with lots of CreateFrame() calls is still a simple thing and not very intensive on the CPU or memory. However, having a config file to define the parameters of the panels rather than storing all the parameters in memory will result in a more "lightweight" feel and will obviously use less memory.

CPU usage and efficiency are not the same thing. Obviously if you have an addon that is really eating up CPU time it's a problem, but you have to consider what the addon is doing to determine whether or not it's being efficient.

Insofar as game stability goes, I haven't run into the issue in awhile, and I don't know if they made any changes for 4.0, but WoW was compiled as a 32-bit application. When it hit 2GBs of total memory usage it crashed right away (total for the game, not my UI). This also seemed to include video card memory usage in some tests we ran.

To an extent, though, a lot of it seems to be like a contest at this point. People are just shooting for lower and lower memory footprints. This isn't really a bad thing, competition breeds creativity. And if something can be done with less memory/CPU usage then that seems like a better and more efficient approach to me.
  Reply With Quote
11-05-10, 05:37 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by d87 View Post
70-100mb is too high.
Really? I've had UIs in the 100-120MB range before, and the game ran fine. Static memory vs. increasing memory due to poor code is key. Static memory does not effect your performance at all. Auctioneer databases, Gatherer databases, Atlas databases, textures/sounds.... All static memory. You probably have 2GB of RAM on your computer. 100MB is no problem.


That said, "lightweight" is a buzz word that is going around lately, which every addon wants to be and every user wants for their UI. Much like the "Make it use Ace2!" or "Ace this addon please!" cries a few years ago.

Whether or not an addon uses the Ace libraries really has no bearing on it being a good addon or not. Same with the term "lightweight". As long as an addon is coded well, it doesn't matter how much memory it uses. And some addons are just going to be CPU intensive no matter what, due to the functions they are trying to do.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-05-10, 05:56 PM   #7
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Personally I'm running an i7 930 processor with 6GB of ram and a GTS250 1GB video card. Performance typically isn't a "huge deal" and if I wanted to turn down some of my video settings, I'm sure I'd see my FPS rise signifigantly as well as reduce any interface lag. I guess my goal was to be able to run most settings at max and still get 60+ FPS in raids. I do have a nice Asus 120hz monitor so I can take advantage of FPS over 60.

Before I made the switch to these lightweight mods I was running in the 30-35 FPS area in ICC25. Now I'm typically in the 45-50 FPS range. I've also notice a pretty significant reduction in interface lag.

I guess my main concern was tracking CPU/sec on my addons. Optionhouse has a nice way of tracking it, but I have yet to find any documentation on what that is actually tracking and of what significance the numbers its reporting.

Last edited by maltese : 11-05-10 at 05:59 PM.
  Reply With Quote
11-05-10, 07:28 PM   #8
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
Originally Posted by d87 View Post
70-100mb is too high.
Not really. Auctioneer and Gatherer can use around those numbers. It especially isn't 'too high' if you have 8GB of ram..like my laptop.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote
11-05-10, 08:02 PM   #9
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
Looks like my "definition" of "lightweight" is slightly different from most of the above.

To me, an addon is "lightweight" if it only does one thing and does that one thing well. If an addon tries to do two things, it should be separated into two addons.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
11-05-10, 08:34 PM   #10
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
Originally Posted by Xinhuan View Post
Looks like my "definition" of "lightweight" is slightly different from most of the above.

To me, an addon is "lightweight" if it only does one thing and does that one thing well. If an addon tries to do two things, it should be separated into two addons.
This, also.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote
11-05-10, 08:46 PM   #11
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Right. Everyone has their own definitions and opinions/preferences on what makes an addon "lightweight".
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
11-05-10, 09:12 PM   #12
maltese
A Wyrmkin Dreamwalker
 
maltese's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 54
Originally Posted by Dreadlorde View Post
Not really. Auctioneer and Gatherer can use around those numbers. It especially isn't 'too high' if you have 8GB of ram..like my laptop.
The issue is wow is a 32 bit application, so even if your computer had 24GB of ram, wow is still only going to use 2GB. Even then I don't think its an issue most people are going to run into unless they start running massive memory intensive UI's and change the config.wtf file to increase the view distance farther than you are able to with the ingame slider.

So far I've only seen one person say something about CPU/sec just being a relative gauge to compare one addon against another you are currently using. Is there not a number that is deemed 'to high'?

Last edited by maltese : 11-05-10 at 09:15 PM.
  Reply With Quote
11-05-10, 09:16 PM   #13
Ailae
A Rage Talon Dragon Guard
 
Ailae's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2007
Posts: 318
It's such a flavour-word, feels like it barely means anything anymore. It's like saying "my goal with this addon was for it to be as efficient as possible". Really? As opposed to what? :P

However, it would be nice to get some sort of context when comparing cpu-measurements. What is 'too much', etc. Or some discussion on best practices, I know there are some available but wouldn't mind skimming through a few more. But I guess it's so tied up in what the addon is trying to do, that it is hard to generalize. For example, is OnUpdate better than Animations, and when? Or when tracking buffs on yourself/others, is it better to use UNIT_AURA, a static OnUpdate-timer or CLEU.

Guess this got a bit long-winded. Anyway, my point was that lightweight and the strive for it has very little bearing in the grand scheme of things. Unless you're really crammed for HD-space.
__________________
Oh, the simulated horror!
  Reply With Quote
11-05-10, 11:34 PM   #14
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
Definitely a flavour word, since another definition of a "lightweight" addon is an addon that doesn't do things you don't want.

Addon X might store data on some item, such as data A, B and C.
Addon Y might store data on the same item, but only store data B and C.
And Addon Z might only store data C.

If addon Z suits your needs, then you would find X and Y bloated and Z is lightweight.

If addon Y suits your needs, then you would find addon Z too simple and addon X too bloated.

See where I'm going?
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
11-06-10, 01:24 AM   #15
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by maltese View Post
The issue is wow is a 32 bit application, so even if your computer had 24GB of ram, wow is still only going to use 2GB. Even then I don't think its an issue most people are going to run into unless they start running massive memory intensive UI's and change the config.wtf file to increase the view distance farther than you are able to with the ingame slider.
You know, up until right now, I hadn't considered that to be my issue in WoW. (With the release of 4.0.1 my performance dropped severely, and I couldn't figure out why. My Config.wtf is editted to have a higher max cam distance.) So thank you :P

For me personally, a lightweight addon is an addon that does no more than what I wanted, and do it efficiently, even though they may use a lot of static memory. Eg. my Actionator uses a good deal of memory, but it's only loaded on my AHMule, so it doesn't bother me.
  Reply With Quote
11-06-10, 03:06 AM   #16
Led ++
A Frostmaul Preserver
 
Led ++'s Avatar
AddOn Author - Click to view addons
Join Date: Jan 2009
Posts: 254
I love people who post their UI and go like "It only takes up 300 Kb! Beat that suckers!".
__________________
  Reply With Quote
11-06-10, 04:17 AM   #17
haylie
A Scalebane Royal Guard
 
haylie's Avatar
Join Date: May 2009
Posts: 417
Oh boy, this discussion again.

Originally Posted by maltese View Post
#1: How much memory usage is to much?
I used to have a really old PC with like 700 MB of RAM and I could still play WoW, though at minimum settings. My memory usage was about 20 MB until I got dragged into the lua-only craze. Even then, at a memory usage of a couple of MB I didn't really see any difference performance-wise.

Memory usage is like gear score, something people use to measure their e-peen.

Originally Posted by Haleth View Post
A lot of minimalistic UIs throw functionality overboard and look at memory only, not taking CPU into account.
A lot of minimalistic UIs think that minimalism = lightweightness from a resource point of view, which is so far off from the truth I wanna bang my head against a wall.

Minimalism is NOT about memory usage, or CPU usage. Minimalism is a design principle. It has nothing to do with memory or CPU. You can have a minimalist UI that uses 100MB, or a non-minimalist one that uses 10.

Originally Posted by Led ++ View Post
I love people who post their UI and go like "It only takes up 300 Kb! Beat that suckers!".
This. As if that somehow justifies poor functionality.

Last edited by haylie : 11-06-10 at 04:22 AM.
  Reply With Quote
11-06-10, 04:26 AM   #18
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
In the last 6 months or so, I've started auto-rejecting any addon that has the words "very simple" and/or "lightweight" anywhere in its description. Something in those terms just equates with "feature-free" to me. I know that's not entirely true but for me it's a knee-jerk reaction I guess.

I'll grab one big, complex addon like Carbonite (that does a lot of stuff I find necessary)over the 60+ "very simple" addons it would take to replace even a small part of what it does.
__________________

~ no need to make the message completely obnoxious - Cairenn
  Reply With Quote
11-06-10, 06:24 AM   #19
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
"Lightweight" can't be without context.

Context in this case are the features.

You can only compare addons within the same context ie very similar feature-set.

"Lightweight" thrown around unqualified is just another buzzword and false advertising for the most part.

That does not however mean that there aren't addons around that do "essentially the same thing" (feature-wise)
If you want a specific example look at all the "out of range/mana" action-button coloring addons.

In that case it is meaningful as a comparative term:
"Addon A" uses less resources (mainly cycles/sec and or increasing memory)
than "Addon B" which does the same thing so it can be said to be more lightweight.

Does that mean that "Addon B" will be detrimental to gameplay?
Probably not, but for someone looking for a specific set of functionalities at the minimum cost
it may be a selection criterion when building their custom UI.

Minimalism is indeed a totally different concept but I don't see how it entered this conversation,
the OP made no mention of minimalism.

PS. Just realized looking over the thread that I'm basically looking at the term same way as Gandoch.
  Reply With Quote
11-06-10, 04:02 PM   #20
Sideshow
A Flamescale Wyrmkin
 
Sideshow's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 103
Lightweight for me is checking every line of code, every function or algorithm, to make it use less cpu, especially in repetitive or looped code.
I've always been a fan of minimalism too.

Last edited by Sideshow : 11-06-10 at 04:07 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » What defines a "lightweight" addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off