-
Type:
New Feature
-
Resolution: Done
-
Priority:
Normal
-
Affects Version/s: 3.9.0
-
Component/s: None
-
Security Level: Jimmy
-
None
-
Sprint 6
user scenario
Like ZSS-867, users load an Excel file as a format template and initialize lots of cells with formulas from a database.
steps to reproduce
- run the attached zul
actual result
it takes a long time to initialize the cells.
debug info
- like
ZSS-867, when using Range API, it takes extra cost at handlePrecedentUpdate() because clearer is not null./*package*/ class ModelUpdateUtil { ... //ZSS-1047: (side-effect of ZSS-988 and ZSS-1007 which consider setHidden() of SUBTOTAL() function) // see ColumnArrayImpl#setHidden() /*package*/ static void handlePrecedentUpdate(SBookSeries bookSeries, Ref precedent, boolean includePrecedent){ //clear formula cache (that reval the unexisted sheet before FormulaCacheCleaner clearer = FormulaCacheCleaner.getCurrent(); ModelUpdateCollector collector = ModelUpdateCollector.getCurrent(); Set<Ref> dependents = null; //get table when collector and clearer is not ignored (in import case, we should ignore clear cahche) if(collector!=null || clearer!=null || bookSeries.isAutoFormulaCacheClean()){ DependencyTable table = ((AbstractBookSeriesAdv)bookSeries).getDependencyTable(); dependents = table.getEvaluatedDependents(precedent); }
Please refer to attached hotspot.png
workaround
- like Importer, use SCell.setFormulaValue(), see fillFormulaAtInternalSheet() in PopulatePerformanceComposer
possible solution
- also update the formula dependencies upon Range.setAutoRefresh()