Apache POI Performance

时光毁灭记忆、已成空白 提交于 2019-12-20 09:45:25

问题


I'm having performance problems with Apache POI. I've read the FAQ where it refers to a performance test. I've run this test with logging off and 4gb of heap and I can't get the tests to run faster than 22 seconds.

This is the test I'm running: http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java

The FAQ says that if I can't get this test to run in under 3 seconds with 50,000 rows and 50 columns that "the problem is with your environment". I've read other comments around the web referring to disabling poi logging and increasing the heap size, but nothing seems to help.

What else can I check to fix my environment?

Machine Specs (Personal desktop machine):

CPU: Intel i7 8-cores
RAM: 16GB
OS: Windows 7 64bit
JDK: 1.8.0_66
POI: 3.13
JVM Params: -Xmx4g -Xms4g -Dorg.apache.poi.util.POILogger=org.apache.poi.util.NullLogger
Command Arguments: XSSF 50000 50 0

I should also mention that the Apache POI jars I'm using came from maven central

I've created a test project on github where you can simply clone the project and run:

mvn exec:java

I hard coded the parameters I'm using so you do not have to enter anything special on the command line. The documentation says this should run in under 3 seconds.

The test project is located here: https://github.com/mikedehaan/poi-test


回答1:


Test results on my machine:

  • HSSF: 2 sec
  • SXSSF: 5 sec
  • XSSF: 27 sec

Machine specs:

CPU: Intel i3-2100, 3.10 GHz, 4-cores
RAM: 16GB
OS:  Windows 7 64bit
JDK: 1.7.0_76

I made profiling and found out that XSSF is slow due to the synchronized methods in xmlbeans and poi-ooxml-schemas libraries. You can notify poi developers and ask to check this case.



来源:https://stackoverflow.com/questions/34246083/apache-poi-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!