On 27/02/2012 11:06, Yegor Kozlov wrote:
Calling setCellType is extra in both cases. Cell.setCellFormula
automatically changes the cell type to CELL_TYPE_FORMULA and
setCellValue to the appropriate time.
Is POI slow with replacing any formulas or only when setting your
special ones: you mentioned that your formulas are complex and it
might be the case.
You can estimate parsing time by calling the formula parser explicitly:
Ptg[] ptgs = HSSFFormulaParser.parse(formula, workbook);
Are you sure it is the bottleneck?
Yegor
Pretty sure, since if I remove all my regexp post processing I gain only few
seconds, and there's really nothing more than that.
Also, there is my other example:
case Cell.CELL_TYPE_FORMULA:
newCell.setCellType(Cell.CELL_TYPE_STRING);
newCell.setCellValue("="+oldCell.getCellFormula());
break;
my purpose was to elaborate the same amount of data, excluding the parse phase.
This version takes 7sec against about 100sec of the "setCellFormula()" version.
I'll try to estimate parsing time as you indicated.
Thanks for helping.
Raffaele C.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]