I am dealing with big amount of data in structures. I start with data in structure struct1 with several fields, and I need to recast it into structure struct2 (with different fields). Let's say each 8 records of struct1 go to 1 record of struct2. Both guys are pretty big, so I cannot keep both in my ram. So I am doing the calculation in a loop and after each operation struct1==>struct2 I delete the used 8 records from struct1, by simply:
I am looping backwards so deleting doesn't change the rest of the indeces. Doing so, struct1 gets smaller as struct2 gets bigger, and my memory is fine. The problem is that the deleting operation is horribly inefficient.
Is there any smart (and quick) way to delete the records in a structure?