I am somewhat new to C# programming and need some advice on how to tackle a problem. I need to process tens of thousands records stored on a SQL Server database, and the processing should be as fast as possible.
To maximize the performance, I am fetching the rows from the database on a background thread when the application starts, because it need to wait for some user input before starting the processing. This approach saves 20% of time of the entire process, but it is very resource hungry in terms of memory footprint (the process is taking 200MB of RAM, and I estimate that the database rows has less than 10MB of raw data).
I'm using a class with members storing data from the database columns, and using ArrayList to store the rows.
Is there another approach to store the data in memory to minimize the consumed memory?