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

--- Comment #17 from Greg Woolsey <[email protected]> ---
(In reply to Javen O'Neal from comment #16)
> (In reply to Nick Burch from comment #15)
> > We do have a stated policy that an evaluator will cache for performance 
> The problem is that Greg stated  in comment 12 that there's a performance
> hit if caching isn't done in XSSFWorkbook, not XSSFEvaluationWorkbook. I am
> comfortable with single-use caching in XSSFEvaluationWorkbook, but
> uncomfortable with the same code in XSSFWorkbook.

I would also prefer not to cache in XSSFWorkbook, but a new
XSSFEvaluationWorkbook is created every time a cell is evaluated, rather than
reusing the same instance for all cells in a calculation/evaluation run.

In fact, the main method in XSSFEvaluationWorkbook,
getFormulaTokens(EvaluationCell), creates a new instance rather than using
itself!  I don't see any shared state in that class or the parent class, so
that seems a likely easy fix - just use itself in the call to
FormulaParser.parse() rather than a new instance.

See attached patch-57840-reuse-XSSFEvaluationWorkbook.txt for the tiny fix. 
Unit tests run a little faster with it for me, too.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to