m
minor spelling and grammatical corrections
(A little tidying) |
m (minor spelling and grammatical corrections) |
||
| Line 23: | Line 23: | ||
* 'Map' entries - Those with non-consecutive integer indexes, and string indexes.- 40 bytes each | * 'Map' entries - Those with non-consecutive integer indexes, and string indexes.- 40 bytes each | ||
An empty table is just the minimum 32 bytes. As you start adding entries then it will begin to accumulate memory in which to store those. Memory accumulation isn't linear however, instead there is an | An empty table is just the minimum 32 bytes. As you start adding entries then it will begin to accumulate memory in which to store those. Memory accumulation isn't linear however, instead there is an exponential algorithm, so that as the table gets larger, incrementally larger numbers of elements are pre-allocated. | ||
For example, the size of a list of numbers increases as follows as new values are inserted: 36, 52, 68, 100, 100, 164, 164, 164, 164, etc.. | For example, the size of a list of numbers increases as follows as new values are inserted: 36, 52, 68, 100, 100, 164, 164, 164, 164, etc.. | ||
| Line 48: | Line 48: | ||
=== Frames === | === Frames === | ||
Since a bulk of a frame's | Since a bulk of a frame's existence is on the C++ side of things, it's a bit difficult to get a true sense of their memory impact, however it's possible to measure the lua footprint of the frame alone. It turns out that a frame's lua footprint is initially just the size of its table representation (76 bytes, in WoW 2.2), there doesn't appear to be any other "magic" internal repository of other data. | ||
Having said that, it's a little tricky to fully test this because many of lua's internal structures (The global environment, the lua string table, the internal C library reference table) are dynamically managed and grow with the exponential algorithm mentioned earlier, so it's possible that there's some table entries there being consumed by the frames. | Having said that, it's a little tricky to fully test this because many of lua's internal structures (The global environment, the lua string table, the internal C library reference table) are dynamically managed and grow with the exponential algorithm mentioned earlier, so it's possible that there's some table entries there being consumed by the frames. | ||