Hi.
I’m looking into using aspose.cells as a calculation engine in a .net web api. I manage to get it working but i need to optimize the performance. so i was wondering if there are any best practises for sped and performce. Now load the excel speed for each request with the help of a WorkbookDesigner();
What is the best way to load the excel file without having the change of getting results of a concurrent request mixed up.
Are there any performace tips for the loading and calculation part?
Well, we already enhanced the relevant modules (internal) for loading/reading and saving/writing MS Excel file formats. Do you find any performance issue, kindly elaborate with a sample application (runnable) to reproduce the issue on our end, we will check it soon. You may zip the project (excluding Aspose.Cells assembly) with template file (if any). Please use dynamic dataset/datatable in your code to remove any inter dependencies so we could execute your sample to reproduce the issue.
By the way, we recommend you to kindly use LightCells or MemorySetting.MemoryPreference mode to reduce memory and enhance performance.
From what you have said, we are not sure whether you are using the calculating engine of Aspose.Cells or just getting data from template file by Aspose.Cells and then do calculation by yourself. If you do calculation by Aspose.Cells, then all data (including formulas, names) should be loaded and we are afraid there is no better way to improve the performance much more. If you do calculation by yourself and only need to get data from template file, then you can choose to load cell value only, which may improve performance of loading template file. And if you can manage the grid data by yourself too, then you can use LightCells APIs for loading template file, which may give better performance for both speed and memory cost.
Anyway, please check the following article relating to LoadDataFilterOptions that will enable you filter data while loading workbook.
If you only need to get cells data from the workbook, then you can load CellValue only:
LoadDataFilterOptions.CellValue
If you only need to read out all data in the template file only once and then manage those values by yourself for being used later in your application, then you can use LightCells to fetch cell data from the template file. Meanwhile, you will still able to use LoadDataFilterOptions to filter data.
It is good to know that you are employing these changes successfully. If you find any problem, please feel free to let us know. We will be glad to help you further.