GrapeCity Documents for Excel (GcExcel) is a fast, high-performance spreadsheet API that requires no dependencies on Excel. With full .NET Standard 2.0 support, you can generate, load, modify, and convert spreadsheets in a .NET Framework, .NET Core, Mono, and Xamarin.

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 competitors on three operating systems: Windows, MAC and Linux.

Check out the details below:

Test machine configuration:

Windows

  • OS - Microsoft Windows 10 Enterprise
  • Version - 10.0.16299 Build 16299
  • System Type - x86_64
  • Processor - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3601 Mhz, 4 Core(s), 8 Logical Processor(s)
  • Installed Physical Memory (RAM) - 8.00 GB

MAC

  • OS - macOS Sierra
  • Version - 10.12.6
  • Architecture - x86_64
  • Processor - 2.7 GHz Intel Core i5
  • Installed Physical Memory (RAM) - 16 GB 1867 MHz DDR3

Linux

  • OS - Ubuntu
  • Version - 16.04 LTS
  • System Type - x86_64
  • Processor - Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  • Installed Physical Memory (RAM) - 4.00 GB

Test application type

  • .NET Core Console Application (.NET Core 2.1)

Test data

We used three types of Excel files for load/save and calculation operations:

  1. LargeValues.xlsx, 136MB, contains a huge amount of number values
  2. LargeFormulas.xlsx, 21.9MB, contains a huge amount of formulas
  3. ComplexFormulas.xlsx, 2.01MB, contains some very complex formulas

Performance measurements

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();

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");

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);
}
stopwatch.Restart();
workbook.Save(Path.Combine(OutFilePath, fileName), null, new SaveOptions() { IsCompactMode = true });
stopwatch.Stop();
saveTime = (stopwatch.ElapsedMilliseconds / 1000d);
Console.WriteLine("Save time" + saveTime.ToString("0.###") + "s");

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;

Performance results

Save memory and time with the lightweight API architecture. GcExcel is fast in loading, saving complex files and calculates formulas quickly. For some of the operations, performance time is less than a second! Check out GcExcel performance in above scenarios.

Performance results on Windows

Performance results on Mac

Performance results on Linux

Performance sample

Download the sample and run the tests on your own!

Our previous performance test is here.

Note: The results were taken on particular machine configurations. If you are running at a different configuration, the values may not exactly match with our collected results. In case you observe any discrepancies in the overall performance, please leave your comments below.

Custom Code Your Spreadsheets in .NET

Download the latest version of GrapeCity Documents for Excel

Download Now!