Bug 48195 - Optimise evaluation of IF() and CHOOSE() - avoid eager evaluation of unused operands
Summary: Optimise evaluation of IF() and CHOOSE() - avoid eager evaluation of unused o...
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.1-FINAL
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2009-11-13 12:56 UTC by Josh Micich
Modified: 2009-11-13 13:52 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2009-11-13 12:56:29 UTC
Sometimes referred to as "short-circuit" evaluation.  The formula Ptg arrays are already marked up with Attr tokens (tAttrIf, tAttrChoose and tAttrSkip) to help with this.  POI currently ignores these tokens, and by default does eager evaluation on all operands.
Comment 1 Josh Micich 2009-11-13 13:52:15 UTC
Applied in svn r835994

junit added 

This is a major performance improvement for spreadsheets that contain formulas with many (possibly nested) IF() functions.

In terms of cpu/time optimisation, this enhancement is probably second only to the formula result caching solution (from bug 45376).  In that bug the actual formulas of the example appear to be well suited to "short-circuit-if" optimisation, but result caching provided biggest gains (for that example and in general).  This enhancement was also previously requested in bug 45508, but the underlying issue there was a bug in OFFSET(), not performance.