Apache的POI性能 [英] Apache POI Performance
问题描述
我在使用Apache POI性能问题。我读过它指的是一个性能测试的常见问题解答。我已经运行该测试记录堆关闭和4GB的,我不能让测试超过22秒跑完更快。
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.
这是我运行测试:
<一href=\"http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java\" rel=\"nofollow\">http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/SSPerformanceTest.java
借助常见问题解答说,如果我不能得到这个测试运行在不足3秒的50,000行和列50说:问题是你的环境。我读过网络上其他意见指禁用POI记录和增加堆大小,但似乎没有任何帮助。
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
我还要提到的是,我使用Apache POI从罐子的 Maven的中央
我创建GitHub上一个测试项目中,你可以简单地复制该项目,并运行:
I've created a test project on github where you can simply clone the project and run:
mvn exec:java
我很难codeD我使用的,所以你不必输入任何命令行上特殊的参数。该文件说,这应该不足3秒的运行
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.
测试项目就设在这里:
https://github.com/mikedehaan/poi-test
The test project is located here: https://github.com/mikedehaan/poi-test
推荐答案
我的机器上测试结果:
- HSSF:2秒
- SXSSF:5秒
- XSSF:27秒
机规格:
CPU: Intel i3-2100, 3.10 GHz, 4-cores
RAM: 16GB
OS: Windows 7 64bit
JDK: 1.7.0_76
我做了分析,结果发现, XSSF
缓慢归因于 XMLBeans的同步方法
和 POI-OOXML-架构
库。您可以通知POI开发商和要求检查这个案子。
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.
这篇关于Apache的POI性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!