poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zach Engel" <...@checkpoint.com>
Subject bad performance in linux
Date Wed, 17 Aug 2005 19:08:19 GMT
Hi

Need some help with the following performance problem:

I have some code that creates a HSSFWorkBook 
(about 400 rows of 10 cells each) and then writes it 
to an output stream (out = HttpServletResponse.getOutputStream())

This takes 2 seconds on a WINDOWS machine.
Here is some info from my log
[17 Aug 2005 18:12:30 DEBUG] - hssf entire write    millis=1908
[17 Aug 2005 18:12:30 DEBUG] - hssf getbytes        millis=497
[17 Aug 2005 18:12:30 DEBUG] - hssf createDocument  millis=713
[17 Aug 2005 18:12:30 DEBUG] - hssf writeFilesystem millis=698

When I run the same code on a linux machine (Linux 2.4.20-13.7),
it takes 7-10 seconds.
Here is some info from my log
[2005-08-17  19:07:21 DEBUG] - hssf entire write    millis=7051
[2005-08-17  19:07:21 DEBUG] - hssf getbytes        millis=4441
[2005-08-17  19:07:21 DEBUG] - hssf createDocument  millis=46
[2005-08-17  19:07:21 DEBUG] - hssf writeFilesystem millis=2562

After downloading the most current POI sources, and debugging a little, 
I discovered that when the getBytes() method (in HSSFWorkbook.write) tries
to serialize the SSTRecord record, it takes about 4000 milliseconds, 
While it takes only about 47 milliseconds on windows 


In addition to that, while investigating the writeFilesystem method, 
I discovered that most of the time is spent writing block2 
(indeed shhet2 contains the 400 rows of data)

>From the Linux log:
[2005-08-17 19:28:02 DEBUG] - hssf writeBlock[1] millis=0
[2005-08-17 19:28:04 DEBUG] - hssf writeBlock[2] millis=2300
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[3] millis=210
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[4] millis=0
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[5] millis=0
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[6] millis=0
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[7] millis=0
[2005-08-17 19:28:05 DEBUG] - hssf writeBlock[8] millis=1


>From the WINDOWS log:
[17 Aug 2005 18:33:31 DEBUG] - hssf writeBlock[1] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[2] millis=1807
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[3] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[4] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[5] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[6] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[7] millis=0
[17 Aug 2005 18:33:32 DEBUG] - hssf writeBlock[8] millis=0






One last thing regarding the LANG environment variable:
While looking for answers on the web I noticed there have been some issues
with encoding settings.
My LANG on the linux is set to en_US.UTF8
I changed it to ISO-8859-1, and then ran the tomcat, 
but the results where the same.

I hope you can offer some kind of explanation to the wide difference between
the 2 environments.

Thank you

Zach Engel
Check Point





---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message