]> source.dussan.org Git - poi.git/commit
Speed up execution of formulas with whole-column area reference
authorDominik Stadler <centic@apache.org>
Sun, 3 Apr 2022 13:25:21 +0000 (13:25 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 3 Apr 2022 13:25:21 +0000 (13:25 +0000)
commitd80f48dd82269964449864acbc81be2eac057884
tree9c1bcab63410497932df7df60e4bd5c7268c99fd
parent86bc671633ed364da060ae8ba998138a6eb2c4c5
Speed up execution of formulas with whole-column area reference

The previous change via r1894675 did not fully solve this as
it only took place when more than one sheet were used.

There were still some cases where evaluating formulas needed
to iterate across a huge number of non-existant rows, e.g.
TestVLookup, which took more than 1 minute locally.

However doing the lowering of row-numbers always would trigger
test-regressions as some Excel-functionality depends on actions
being possible on rows larger than current "last row" in the sheet.

Thus changed this to a slightly different approach which only adjusts
last-row when it is at or above the workbook-limit of rows

Execution of TestVLookup is now at 1-2 seconds!

Also added a test-case to verify details of the implementation now.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899533 13f79535-47bb-0310-9956-ffa450edef68
poi/src/main/java/org/apache/poi/ss/formula/SheetRangeEvaluator.java
poi/src/main/java/org/apache/poi/ss/formula/SheetRefEvaluator.java
poi/src/test/java/org/apache/poi/ss/formula/SheetRangeEvaluatorTest.java [new file with mode: 0644]