Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Memory usage and lists

Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
11-28-2005 07:27
I am working on a project right now that uses a list to store keys, short strings and positions. In an earlier version, I used three separate lists, but in my current version, I changed it to one strided list. Intuitively I thought it might use less memory to use the one list, but it appears that using multiple lists uses less memory.

When I was adding 1 entry to three lists, I used around 170 bytes of memory per new entry. Now with 1 list, it seems to be eating about 200 bytes of memory per entry.

Does this seem right? Are lists more memory efficient if they only contain one type?
_____________________
imakehuddles.com/wordpress/
Keiki Lemieux
I make HUDDLES
Join date: 8 Jul 2005
Posts: 1,490
11-28-2005 07:44
Hmm... another observation is that the list seems to get more memory efficient, the more entries you add.
_____________________
imakehuddles.com/wordpress/
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
11-28-2005 07:52
Because you can't change a list "in place", long lists can have a high momentary cost in script memory when being manipulated.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
11-28-2005 09:27
Several lists does seem to take up less memory than one long one in my experience and testing too.

And certainly manipulating longer lists takes more time and power, I think the buzz words are n^2 lists for lsl compared to some other process - but basically the longer the list gets its a power relationship rather than a simple multiple relationship, so 3 lists of length n would be 3n^2 to process, one list of length 3n would be (3n)^2 or 9n^2 to process - much slower.