Thread Tools Display Modes
07-27-06, 11:02 AM   #1
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
Lua variable size

I know Iriel posted a nicely written summary on table/string memory usage on the WoW forums but I was unable to locate the post.

I'd like to know if any one has a link to the post or a copy of it.

-------- This is why I am asking

Basically I'm storing information about a unit (health/dps/hps) for the entire duration of a fight and I don't want it to eat more memory than it absolutely has to. (A combination of 2 addons, HealthHistory and CombatGraph).

I plan on using polling because it seems easier.

So far, the 2 best options to store health information I have thought of are:
Code:
-- a table holding all the health information
_hTbl = {
    [name] = {
        [1] = { health=<previous health %>, count=<# of polling cycles @ this %> },
        [2] = { health=<current health %>, count=<# of polling cycles @ this %> },
    }
}
and (the one I like)
Code:
-- table holding just the health percentage changes
_hTbl = {
    [name] {
        [1] = <percentage 1>,
        [2] = <percentage 2>,
        [3] = <percentage 1>,
    }
}
-- table holding how many data points at each percentage
_percTbl = {
    [name] = {
        [percentage 1] = {
            [1] = <# of polling cycles at this percentage>,
            [2] = <# of polling cycles at this percentage>,
         },
        [percentage 2] = {
            [1] = <# of polling cycles at this percentage>
        }
    }
}
for both of the options, i'm rounding the percentage to 3 digits to limit the number of possible values.

Right now I'm just worrying about health and will get to DPS/HPS next . Someone help me make this not eat memory more than it has to.
  Reply With Quote
07-27-06, 11:30 AM   #2
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
The information from the main forum thread can be found here:

http://www.wowwiki.com/Memory_Usage

I have a more detailed analysis somewhere for some of the more complex data types (closures, functions, etc), but dont remember where I put it right away.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Lua variable size


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