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.