Posted 29 June 2022, 3:12 am EST
Hi Richard,
While setting a large amount of formulas and values, the best practice is to use the suspendCalcService/resumeCalcService methods and suspendPaint/resumePaint methods for performance enahancement.
The suspendCalcService method will stop the calculation process until the formula settings are complete. Later, the resumeCalcService method can be called to restore the calculation system. Both of these methods enhance performance to a great extent especially when users have massive worksheets with a lot of formulas.
The suspendPaint method allows users to stop the repaint process while the modifications are being done. After integrating all the changes, users can invoke the resumePaint method. Both of these methods enhance the overall performance because Spread will now paint only once after all the changes have been done.
Using these methods and the sample that you provided, I checked with the latest version of SpreadJS(V15.1.2) and the performance was highly improved( not taking 1 minute as mentioned by you.): https://jscodemine.grapecity.com/share/XsGLiJpK9k2ascgqxFkuXA/
In the sample, when you click the “setFormula” button, it will show “Loading…” for all the cells despite suspending the calc service and paint. This is a know issue to us for which the tracking id is: SJS-13266. The devs are working on fixing this issue. We will let you know when we have an update for you.
API Docs:
suspendPaint and resumePaint: https://www.grapecity.com/spreadjs/docs/latest/online/UsingsuspendPaintandresumePaint.html
Set Large Amounts of Formulas: https://www.grapecity.com/spreadjs/docs/latest/online/SettingLargeAmountsofFormulas.html
Regards
Ankit