lundi 27 juillet 2015

Best pattern for loading resources (files) into memory and then reuse

I'm in the process of writing an application that uses a 3rd party library (NPOI) to read/write data to excel spreadsheets. My application needs to load 25 (or more) spreadsheets into memory, and then input values into each spreadsheet, and then read values from calculated cells within the spreadsheet. Because all files are 40MB in total, it takes 3-4 seconds to load all of them into memory and then performance my calculations.

I want to design my app so that it loads the files into memory at startup, and then only references the file stream of each file in memory when it needs to do calculations. I've been looking at Memory Mapped Files, but im not sure this will work for me.

Any advise as to what the best way is to manage these files in memory?

Aucun commentaire:

Enregistrer un commentaire