WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   What defines a "lightweight" addon (https://www.wowinterface.com/forums/showthread.php?t=36556)

maltese 11-05-10 04:16 PM

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?

Petrah 11-05-10 04:29 PM

Quote:

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

Haleth 11-05-10 04:37 PM

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).

d87 11-05-10 04:39 PM

Quote:

#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.

Quote:

#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.

Gandoch 11-05-10 04:39 PM

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.

Seerah 11-05-10 05:37 PM

Quote:

Originally Posted by d87 (Post 216499)
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.

maltese 11-05-10 05:56 PM

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.

Dreadlorde 11-05-10 07:28 PM

Quote:

Originally Posted by d87 (Post 216499)
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.:banana:

Xinhuan 11-05-10 08:02 PM

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.

Dreadlorde 11-05-10 08:34 PM

Quote:

Originally Posted by Xinhuan (Post 216527)
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.

Seerah 11-05-10 08:46 PM

Right. Everyone has their own definitions and opinions/preferences on what makes an addon "lightweight". :)

maltese 11-05-10 09:12 PM

Quote:

Originally Posted by Dreadlorde (Post 216523)
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.:banana:

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'?

Ailae 11-05-10 09:16 PM

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.

Xinhuan 11-05-10 11:34 PM

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?

MoonWitch 11-06-10 01:24 AM

Quote:

Originally Posted by maltese (Post 216535)
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.

Led ++ 11-06-10 03:06 AM

I love people who post their UI and go like "It only takes up 300 Kb! Beat that suckers!".

haylie 11-06-10 04:17 AM

Oh boy, this discussion again.

Quote:

Originally Posted by maltese (Post 216494)
#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.

Quote:

Originally Posted by Haleth (Post 216498)
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.

Quote:

Originally Posted by Led ++ (Post 216567)
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.

voodoodad 11-06-10 04:26 AM

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.

Dridzt 11-06-10 06:24 AM

"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.

Sideshow 11-06-10 04:02 PM

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.


All times are GMT -6. The time now is 08:24 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI