https://bz.apache.org/bugzilla/show_bug.cgi?id=62993

--- Comment #3 from Axel Howind <a...@dua3.com> ---
Created attachment 36315
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36315&action=edit
Patch that fixes bug 62993

Patch to fix Bug 62993

`XSSFEvaluationSheet` uses an internal cache to speed up evaluations. It also
contains an integer field `_lastDefinedRow` to avoid calling `getLastRowNum()`
for the spreadsheet which is costly because it looks up the last entry in a
sorted map which should be O(log(n)) for the implementation used (with n being
the number of rows).

The problem is, that `_lastDefinedRow` is evaluated only once when the
`XSSFEvaluationSheet` is created and not updated when rows are added later.

This patch removes `XSSFEvaluationSheet._lastDefinedRow` and instead always
uses `_xs.getLastRowNum()`. Runtime performance should be unaffected or even
better because I moved the optimization (caching of the last row number) up to
`XSSFSheet`, so that other code will also benefit.

Please review and comment.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to