tags:

views:

323

answers:

4
+2  Q: 

POI performance

I am using POI in my J2EE web application to generate a workbook. However, i find that POI takes around 3 mins to create a workbook with 25K rows(with around 15 columns each). Is this a POI performance issue , or is it justified to take that much of time? Are there other APIs known for better performance ?

+3  A: 

I would be very surprised to see POI take that much time to generate such a file. I just generated a sheet with 30000 rows x 10 cells in about 18s (no formatting, to be fair). The cause might be one of the following:

  • POI logging might be turned on, as described here
  • you are running from swap memory
  • your VM available heap might be very low
Tomislav Nakic-Alfirevic
Will having international characters make the processing slower?And another question, how can increasing VM memory improve performance?
The Machine
I don't believe international characters would make this kind of processing any slower: it's mostly about the amount of data.As for VM available heap, as the required amount of memory comes close to the available heap, the garbage collector has to kick in more often: in extreme cases, most of the CPU time is spent garbage collecting. This is a specific situation: it's not likely you're significantly affected by it.
Tomislav Nakic-Alfirevic
+1  A: 

We also use POI in our web app and do not have any performance issue with it - although our generated documents are far smaller than yours. I would first check if POI is the real issue here. Try to generate those documents without the J2EE-overhead (Unit-Test) and measure the performance. You could also monitor the load and memory usage on your J2EE server to see if the problems come from some suboptimal system settings.

pitpod
+1  A: 

If none of the other answers work out, see if Andy Khan's JExcel will be better. I've found it to be far superior to POI for dealing with Excel in Java.

duffymo
A: 

Could you specify which file format you are using? If you are using HSSFWorkbook (.xls) then POI should not take that long. However, if you are using XSSFWorkbook (.xlsx) then POI may take that long due to xml processing.

For me it took 3 min to generate xlsx file of 27K. If anybody else created xlsx (XSSF format) with less time, could you enlighten me? I need xlsx to avoid 65K limit by *.xls but since xlsx uses too much memory, I was never successful to create 80K file even with heap memory of 1.5 G.

Bill Jung