GrapeCity Documents for Excel (GcExcel) is a fast, high-performance spreadsheet API that requires no dependencies on Excel. With full .NET 6 support, you can generate, load, modify, and convert spreadsheets in a .NET 6, .NET Framework, .NET Core, Mono, Xamarin, and cross-platform applications.
Real-time Excel files generally contain masses of sheets, large data, complex formulas, tables, etc. In .NET applications, developers want to load such files, calculate formulas, save files and work with real-time data. When you use an Excel API, you have more control over calculations, the movement of information, and its security.
We have continually been monitoring the performance of GcExcel and improving it with every release. We recorded the performance time and memory consumed for load, save, and calculation operations with GcExcel in comparison with a few competitors on three operating systems: Windows, Mac, and Linux.
Check out the details below.
Take total control of Excel documents with the fastest spreadsheet API available for .NET 6. Download Today!
We used three types of Excel files for load/save and calculation operations:
The time taken and memory consumed were recorded for the load, save, and calculation operations for the above test data.
Here is the code used:
var fileName = Path.GetFileName(inputFile);
Console.WriteLine("Benchmark for GcExcel");
Console.WriteLine();
Console.WriteLine("FileName: \"" + fileName + "\"");
Console.WriteLine();
//Capture Load time
Workbook workbook = new Workbook();
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
workbook.Open(inputFile);
stopwatch.Stop();
openTime = stopwatch.ElapsedMilliseconds / 1000d;
Console.WriteLine("Open time:" + openTime.ToString("0.###") + "s");
//Capture Memory footprint
long memorySize = GC.GetTotalMemory(true);
memSizeAfterOpen = (memorySize / 1024d / 1024d);
Console.WriteLine("Used Memory:" + memSizeAfterOpen.ToString("##.###") + "M");
Console.WriteLine();
stopwatch.Restart();
workbook.Dirty();
workbook.Calculate();
stopwatch.Stop();
calcTime = (stopwatch.ElapsedMilliseconds / 1000d);
Console.WriteLine("Calclate time" + calcTime.ToString("0.###") + "s");
memorySize = GC.GetTotalMemory(true);
memSizeAfterCalc = (memorySize / 1024d / 1024d);
Console.WriteLine("Used Memory:" + memSizeAfterCalc.ToString("##.###") + "M");
Console.WriteLine();
if (!Directory.Exists(OutFilePath))
{
Directory.CreateDirectory(OutFilePath);
}
// Capture Save time
stopwatch.Restart();
workbook.Save(Path.Combine(OutFilePath, fileName), new XlsxSaveOptions() { IsCompactMode = true });
stopwatch.Stop();
saveTime = (stopwatch.ElapsedMilliseconds / 1000d);
Console.WriteLine("Save time" + saveTime.ToString("0.###") + "s");
// Capture Save Memory
memorySize = GC.GetTotalMemory(true);
var memSizeAfterSave = (memorySize / 1024d / 1024d);
Console.WriteLine("Used Memory: " + memSizeAfterSave.ToString("##.###") + "M");
Console.WriteLine();
// Prevent the GC collect the workbook before we show the memory size.
workbook.Worksheets[0].Cells[0, 0].Value = 1;
Save memory and time with the lightweight API architecture. GcExcel is fast in loading, saving complex files, and calculating formulas quickly. Check out the performance comparison in the screenshots below:
Download the sample and run the tests for GcExcel APIs on your own!
Note: The results were taken on particular machine configurations. If you are running at a different configuration, the values may differ from our collected results. In case you observe any discrepancies in the overall performance, please leave your comments below.
Take total control of Excel documents with the fastest spreadsheet API available for .NET 6. Download Today!