FREE SQL Developer database jobs plugin
Java based IDEs (Integrated Development Environment), like Eclipse, Netbeans or JDeveloper are becoming more and more the main tool ...
Performance battle – Open XML Format SDK 2 vs SpreadsheetGear 2009
View Comments
Recently, I have written about my issue with Excel file generating in C#. To solve it I’ve used the most popular Microsoft’s Open XML Formt SDK 2.0. Unfortunately I wasn’t able to beat performance limitations of Open XML SDK so I wrote post on StackOverflow.com and I’ve got one concrete answer with an example. This answer stated that: SpreadsheetGear can create an xlsx workbook with 1,000,000 rows… in 74 seconds. Nice, I need to try it.
A few words about opponents
Open XML Format SDK
Microsoft’s Open XML Format SDK provides very simple creating Open XML code from the scratch. About this SDK I wrote a lot on my other posts: about quick Excele file generating and Open XML SDK performance.
SpreadsheetGear 2009
All I know about this library for .NET is that it is very fast, has many features and unfortunately is expensive. More about this component you can read on SpreadsheetGear site. In my tests I’ve used 30-day evaluation version.
What is faster?
I made tests in ANTS performance Profiler. I created Excel spreadsheet with 100 000 rows and 4 columns of data.

Open XML Format SDK 2.0 application performance
As you can see above Open XML Format application was finished in about 18 seconds and memory usage reached 150 MB .

SpreadsheetGear 2009 application performance
Application that uses SpreadGear2009 was finished in about 5.5 seconds and memory usage reached 21 MB.
Additionally I carried out test with 1 000 000 rows of data. Application using Open XML Format SDK did’t respond for about 10 minuts and I had to kill it because I couldn’t use my computer. My profiling tool was showing me that application use 92% of free memory und use 95 % of processor. Second application surprised me. See below why:

SpreadsheetGear 2009 application performance with 1 000 000 rows
1 000 000 rows was generated in about 26 seconds using 190 MB of memory.
Main differences
Performance differences are huge. Application based on SpreadsheetGear is over 3 times faster and uses 7 times less memory in test with 100 000 rows. This component manages even with 1 000 000 rows in very good time and memory usage while Open XML Format SDK application doesn’t work at all.
Besides, I noticed one more significant difference. A SpreadsheetGear API is simpler and more useful than Open Xml Format SDK. It is very intuitive and has good documentation with a lot of helpful examples. The same application for generating Excel spreadsheet that I coded using SpreadsheetGear has 4 times less lines of code than SDK application. On the other hand, Open Xml SDK in version 2 has also great advantages. It has additonal tools for creating and manipulating Open Xml files.
And the last and very important difference. Price! As I mentioned above, SpreadsheetGear is relatively expensive. 1 Developer subscription costs $999 and for me it is a lot. On the other hand, Open Xml Format SDK is free and has great support because it is a Microsoft product.
What should you choose?
For me the decision is very simple. If you want to generate a huge amount of data and use this library very often, buy and work with SpreadsheetGear. If you want to generate smaller files, performance is not critical, then I would suggest using Open XML Format SDK 2.0.
Share your opinion and experience with us below or meet us on Twitter: @GOYELLO.
Thanks to Karol Świder for helping me write this blog post.
-
filipk

