Before GrapeCity Documents, server-side document components were represented by Apache POI, an open source API library written in Java that was used to read, write, create, and maintain Microsoft Office Documents.

But as POI is defined: an acronym for Poor Obfuscation Implementation, Apache POI provides only a “simple fuzzy Implementation” that often struggles to create large documents with complex logic.

What if you want to quickly create, load, edit, import/export large documents (Excel, Word, PDF) and deploy them to the cloud using simple code logic?

These are exactly the needs that GrapeCity Documents can fulfill.

What are GrapeCity Documents?

GrapeCity Documents is a fast and efficient server-side documentation package that runs perfectly on Windows, Mac, Linux, and both.NET and Java platforms. Provides the ability to quickly generate, load, edit, and save Excel, PDF, and Word documents without relying on Microsoft Office and Acrobat components.

GrapeCity Documents consists of four components for different Documents and development frameworks:

· Excel document API for all.NET platforms — GcExcel (.NET)

· Excel Document API for all Java platforms — GcExcel (Java)

· GcPDF, PDF document API for all.NET platforms

· Word document API for all.NET platforms — GcWord

Next, we will take GcExcel as an example to compare its features and performance with Apache POI in detail.

Features comparison: GcExcel VS Apache POI

  1. Formula for the number

GcExcel supports 452 Excel formulas.

The number of supported formulas in the Apache POI is small (although the Apache POI website lists more than 280 assessable formulas, only 157 are shown in the API).

  1. Whether to export PDF files

GcExcel not only supports export PDF format, but also controls page setting options.

Apache POI does not support PDF export.

  1. Conditional formatting

GcExcel supports a variety of conditional formats, such as custom icon sets, AboveAverage, occurrence date, Top 10, and duplicates, and these conditional formats are set according to the same rules as VSTO.

However, in Apache POI, the use of advanced apis to add conditional formatting judgment is limited. Therefore, only low-level classes marked for internal use can be used to handle formatting options such as Top10, AboveAverage, etc.

  1. Chart type

The chart interface of GcExcel is the same as VSTO, supporting approximately 53 chart types.

Apache POI has very limited support for charts and only supports Line, Bar, Column, Scatter and Radar charts.

  1. Mini figure

GcExcel fully supports adding and configuring Sparklines.

Apache POI does not currently support Sparklines.

  1. Cut, copy and paste shapes

GcExcel supports cutting, copying, and pasting shapes; Apache POI does not.

  1. Filter data type

GcExcel has extensive support for text, number, date, color and icon filters.

Apache POI supports only basic AutoFilters, and you need to use low-level classes to implement application filtering or create any other advanced filters.

  1. The sorting

GcExcel supports all types of row sorting, column sorting, custom sorting, color sorting and icon sorting.

Apache POI does not have built-in sorting capabilities. However, users can use shiftRows ()/ShiftColumns () and sort the data programmatically.

  1. slicer

GcExcel supports slicers with Pivottables, while Apache POI does not.

  1. Exporting in CSV format

GcExcel can be exported to CSV format.

Apache POI does not provide a built-in export CSV option. However, you can programmatically create the corresponding CSV/HTML file.

  1. The gradient

GcExcel supports gradient fill, while Apache POI does not.

  1. Gets/sets values in the cell

GcExcel performs better than Apache POI when performing fetch/set values on a single cell.

  1. Examples and help documentation

With Apache POI, many functions require access to and understanding of the underlying API, but the limited number of examples and documentation provided by Apache POI can be costly for developers to learn.

GcExcel, as a platform-independent API component, has the characteristics of high performance, low memory consumption, and is strictly compatible with Excel object model. GcExcel is easier to use and more comprehensive, through its online demonstration examples and help documents, developers can quickly get started, quickly master product use skills.

Performance comparison: GcExcel VS Apache POI

Let’s compare the performance of GcExcel against Apache POI with a GcExcel Java benchmark project. This project is a Java Gradle project that outputs performance results for GcExcel, POI, and Aspose.Cells as follows:

· Setup: Get and save the double/string/date value of 100,000 * 30 cells. The figure below shows the result of double value.

· GcExcel takes no more than 0.2s; Apache POI is around 18.7s

· Setup: Calculate and save the formula for 20,000 * 30 cells as follows:

· GcExcel takes less than 1S; Apache POI is around 10S

· Open and save a 20.5MB Excel file containing many data, formulas and cell formats, resulting in the following:

· GcExcel takes no more than 4.9s; Apache POI is around 10S

· GcExcel memory consumption is 72.1MB; The Apache POI 3518.2 MB

conclusion

As you can see from the above results, GcExcel is by far the fastest and least memory-consuming server-side spreadsheet component.

Although Apache POI is free, its speed and memory consumption are nowhere near the standard for enterprise-class projects, which is why I chose only 100,000 * 30 cells, because even at 1,000,000 * 30 cells, GcExcel Java still runs smoothly.

In addition, for Apache POI to run successfully, the JVM must also have a minimum heap size of 4G, otherwise it will throw an OutOfMemory exception. Here is the JVM configuration in build.gradle:

applicationDefaultJvmArgs = ["-Xms4096m"."-Xmx8192m"]
Copy the code

You can download the test project from GitHub:

Github.com/GrapeCity/G… And run it using the following command line:

  • On MAC:./gradlew run –args=”double” // Arguments can be double, string, date, formula, bigfile
  • On Windows: gradlew run –args=”double” // Arguments can be double, string, date, formula, bigfile

Note that the first run is very slow as it requires downloading Gradle and all the associated packages.


GrapeCity Documents performs better than Apache POI in terms of speed and memory consumption.

If you also need to process Excel, Word, and PDF Documents on the server, you can go to the official website of GrapeCity Documents to download and try them out.