xlsgen > overview > Performance

The throughput of xlsgen is 200,000 cells per second on a low-end 800Mhz PC.

xlsgen was used to produce medium and large Excel documents. And then both generation time and file sizes were compared to the latest offerings from Microsoft using Excel automation code.

A document with 30,000 cells was produced first, and then another one with 600,000 cells. The machine that executed the test was a low-end PC (celeron 800Mhz, Windows 2000 Pro, 256MB RAM, standard display card, with Excel 2003 installed).

The small Excel automation code to reproduce the tests is provided here. To run this test, fire up any VB or VBA-authoring language (Word for instance), then go to the VB editor, add a reference to the Excel type-library (Microsoft Excel 11.0 Object Library) and paste this code :

Sub BenchmarkTest()

  Dim engine As Application
  Set engine = CreateObject("Excel.Application")

  Dim wbk As Workbook
  Set wbk = engine.Workbooks.Add

  Dim wksht As Worksheet
  Set wksht = wbk.Worksheets(1)

  ' produce 30,000 unique cells
  For r = 1 To 30000
    wksht.Cells(r, 1) = 5000 + r
  Next

  ' save the resulting file
  wbk.SaveAs ("c:\myfile.xls")

  engine.Quit

End Sub

The same code was then used to produce that document using xlsgen. The fact that VB or a lower level language like C/C++ does not matter much since early binding is used in both cases, and on the other hand, xlsgen has a high-performing object model. Regardless, xlsgen bypasses the gigantic amount of time spent crossing the process boundary (COM method marshalling), unlike Excel automation. The latter is the first and foremost reason why xlsgen is so fast.

The resulting generation times are interesting. 114 seconds for the Excel automation code, in order to produce a 30,000-cell workbook. Under one second for xlsgen. A larger test with 600,000 cells instead of 30,000 led to the same conclusion : the conclusion that a native Excel generator is an amazing alternative when it comes to producing Excel documents.

The conclusion can be further summarized with the following chart :


Comparing xlsgen and Excel automation generation performance

 

But there is even more to it. Excel XP and 2003 have introduced alternative file formats than the native .xls, namely xml markup and html markup. The previous .xls files (30,000 cells and 600,000 cells) were then exported using Excel 2003 in xml and in html, only to confirm that .xls is far from having any competitor in the foreseeable future. Figures speak for themselves :

generator  30,000 cells    600,000 cells  
xlsgen537 kb10,636 kb
Excel 2003 xml2,576 kb32,161 kb
Excel 2003 html4,101 kb24,782 kb

The difference is the price to pay at generation time, export time, transport time (if you ever dare send xml/html files through the wire), processing time (xml/html parser) and rendering time (xml/html renderer, Excel engine).

 

 

xlsgen documentation. © ARsT Design all rights reserved.