JasperTeng opened a new issue, #1506:
URL: https://github.com/apache/poi/issues/1506
When a lot of ArrayFormula are added to `XSSFSheet`, performance could come
to a crawl.
This is because `isCellInArrayFormulaContext` cycles through all
arrayFormulas.
Is I have a worksheet with 10k arrayFormulas, and I cycle through every
cell, to check `isCellInArrayFormulaContext`, it would be at least 10k * 10k
checks.
The fact that related functions are very common, makes it impactful. For
example:
* `XSSFCell.getCellType()` -> `isFormulaCell()` ->
`getSheet().isCellInArrayFormulaContext(this)`
* `XSSFCell.getCachedFormulaResultType()` -> `isFormulaCell()` ->
`getSheet().isCellInArrayFormulaContext(this)`
* `XSSFCell.getCellFormula()`
* -> `getCellType()` -> `isFormulaCell()` ->
`getSheet().isCellInArrayFormulaContext(this)`
* -> `isPartOfArrayFormulaGroup()` ->
`getSheet().isCellInArrayFormulaContext(this)`
I think the easiest fix might be to change `List<CellRangeAddress>
arrayFormulas` to `Map<CellAddress, XSSFCell>`, to map cells which are
arrayFormulas to their first cell, where `CellRangeAddress` can be found.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]