0

I'm currently using apache POI to automatically tranfers data from xls file to xlsm file after some process. I have strong executing time constraint and the setters on XSSFCellStyle is very time consuming.

In fact i have files with thousands of cell to transfert and method on boder (SetBorder & SetBorder color) take 3 ms to 5 ms to execution each on 1 cell. In my context 1300 thousands it takes 30 sec to execute.

In a graph on JProfiler, we can see the most time spend on these methods is in state "waiting".

Is it normal for you or not ?

Thanks a lot!!

Wodric
  • 55
  • 3
  • 13
  • not normal. we would need to see your code. But in general when I used POI, I tried to make styles as modular as possible(OOP). set up classes that have a complete cell style rather than just determining it via a decision structure. – woodlumhoodlum Feb 21 '14 at 17:17
  • Cell Styles live at the workbook level, and should be re-used between cells that share the same style. Make sure you're only creating one cell style per unique style of cell, and not one per cell! – Gagravarr Feb 21 '14 at 17:56
  • thanks, i need to rework my algorithm I think – Wodric Feb 24 '14 at 08:24

1 Answers1

0

in for example org.apache.poi.xssf.model.StylesTable.putStyle( XSSFCellStyle ) they try to find the xfs twice.

It uses an ArrayList.

The more cells, the slower this operation is.

If you can, try to avoid a lot of dates.

user3666197
  • 1
  • 6
  • 50
  • 92
Wuf
  • 1