Over the last few months, Swift Calcs has been testing a new Computation Tree to help speed calculations in Swift Calcs. We are happy to announce that this new intelligent computation scheme is now live, and we expect our users to see an increase in computation speeds for complex worksheets.
Out with the old
Prior to today, Swift Calcs used a blind computation scheme, similar to python or other scripting languages, to perform calculations. In this method, whenever any item in a worksheet was changed, that line and all following lines were automatically recalculated.
This behavior made a simple assumption: If an item changes, any later item in the worksheet might be impacted, so they should all be recalculated.
Although effective, this calculation scheme is quite inefficient. Many later items may not be impacted by a change, and recalculating them is unnecessary, wasting system resources and time. In the worst cases, long worksheets with hundreds of lines would be completely recalculated when a simple definition, with no impact on the remaining worksheet, was changed at the top of the page.
In with the new
The Computation Tree is our answer. Now, Swift Calcs intelligently links lines in your worksheet based on the independent and dependent variables in each line. When something in a worksheet is changed, Swift Calcs will now only recalculate later lines that depend on the item that was originally changed. When these dependent lines are updated, any lines that are dependent on these lines are then updated as well, and so on, until all dependencies on the original edit are resolved, and the worksheet is fully updated.
It's a bit more work on our end to build the tree on the fly, and we have worked hard testing this feature to ensure the accuracy of our tree building algorithms. That work has paid off: on complex worksheets, this new calculation scheme results in computation improvements of over 10x, as lines un-impacted by a change are passed over instead of needlessly recalculated.
Live now on Swift Calcs
The Computation Tree is now live and running. Since Swift Calcs is cloud-based, you already have it and its already working. Enjoy more efficient calculations with Swift Calcs!comments powered by Disqus