I have a dataset full of rows that I must initialize into myclass
and then process.
I am currently looping through each row in the dataset, initializing a new instance of myclass
, then adding that instance to a list with type myclass
.
I then loop through the list and conduct a process on each instance (for purpose of the example, let's say I must send each instance as a SOAP message).
My question is, do I keep the structure as is (with a list of myclass
instances) or do I ditch the list and just process my instance (ie send the SOAP message) within the same loop that I initialize the object? I would basically leverage a new method within myclass
to send this SOAP message.
I care about performance and memory usage. It is a batch process where I must process 20,0000 rows at a time. I have limited resources on the host server.
Additional info: If an initialization errors or a SOAP send fails, I want to continue with my processing of each row...