Hi, I have quite a lot of data to store, read and modify in memory while the application works. The data could be compared to a tree, where each node is described by limited number of strings and integers, and has quite a lot of subelements. Currently the data is stored using classes/objects, like
TRootElement = class
fName, fDescription: string;
fPos: integer;
/// etc
fDocs: TObjectList; //list of TVariable = class(TRootElement)
fClasses: TObjectList; // list of TClass=class(TRootElement)
currently the memory consumed by the program is unacceptable, thus I'm looking for the solution to limit it.
My question is: will the consumption be significantly reduced if I replace current, OOP and Objects based architecture with one based on records? For example, the general record could contain:
TRootElement = record
fType: TElemType; // enum: root, variable, class, etc ...
fName, fDesc: string;
// all the fields used by root elem and it's descendants there
Should I replace TList with pointers to next / previous elements? Since I'm never accessing the elements of list by index, I'm always looping through the whole list, it shouldn't be really hard to do... however I'd like to avoid it if not necessary.
Thanks! m.