123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|680|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> Data structures vs banks

Fri, 16 Jul 2010, 11:16
HoboBen
Is there actually any advantage of doing:

Type myType
field1: Integer
field2: Integer
field3: Integer
EndType

Versus...

Type myType
bank: Element
EndType

field1 = PeekInteger(myType.bank, 0)
field2 = PeekInteger(myType.bank, 4)
field3 = PeekInteger(myType.bank, 8)

Specifically, I am going to be working with data that won't all fit into memory at once, and rather than converting binary -> data structure -> binary, I was thinking that I can simply read binary straight into the element and save it back out.

-=-=-
blog | work | code | more code
Fri, 16 Jul 2010, 13:07
Jayenkai
I'm not sure, but I'm pretty sure that loading the full bank, or a sizable chunk of it, is a boatload quicker than loading hundreds of little int's.
Other than that, it's just down to how you handle it, I think..

-=-=-
''Load, Next List!''
Sun, 18 Jul 2010, 15:11
mindstorm8191
I was once working on a RPG type space shooter called Garbage Invaders. The game took a lot of type structure lists, some of which I couldn't determine the size of before-hand. I made use of a lot of object lists, which worked pretty well. For example:


For the purpose of holding larger-than-memory data structures, it depends on the structure of the data you're trying to hold. But if its in a binary form already, its probably better off using a bank for 90% of your needs, especially if it can be manipulated without trouble in this form.

-=-=-
Vesuvius web game