Faster evaluation in Analytica 4.6
As we celebrate the release of Analytica 4.6 this week, I thought I would share the results of some benchmark timings that I carried out to test how the evaluation speed in 4.6 compares with the previous two Analytica releases.
As with every release, there have been numerous changes that we hope speed things up on average. In Analytica 4.6, there have been several examples of this, including these
- An improved algorithm for evaluating the Iterate function when it appears within a Dynamic loop (i.e., a convergence at a particular time step). In this specialized situation, this changes the complexity of the overall evaluation.
- An ability to detect certain cases when iterated slices will end up not being in the final result, allowing computation of those slices to be skipped.
- Internal improvements to memory allocation and deallocation, resulting in a generalized speed-up across array operations, especially those involving arrays containing only numbers and null.
Although these sound awesome on the surface, in a codebase that is already as highly optimized as Analytica, every change that improves one situation almost always impacts other situations negatively. So the important question is how well (and whether) the changes improve speed on average over the situations that arise in substantial real-life models.
To measure this, we measure evaluation speed across several large models that Analytica modelers have built. These benchmarks were chosen independent of the enhancements in 4.6 (with one exception -- the Iterate in Dynamic enhancement mentioned above was motivated specifically by the RP1 application. I exclude this one from the averages). All these models are models that make use of a wide breadth of Analytica features and carry out a large amount of computation. To protect the proprietary nature of several of these benchmarks, I have assigned cryptic 3-character names to each. All results are measured in elapsed clock time, all measured on the same computer (Intel Core i7-2600 @ 3.4GHz, Windows 7) with no other applications running and all using 64-bit editions of Analytica.
|Benchmark||Elapsed time (Seconds)||Speed-up|
|Analytica 4.4||Analytica 4.5||Analytica 4.6||4.4 to 4.6||4.5 to 4.6|
The RP1 result was not used in the average, since as mentioned earlier one of the enhancements was created for this model and obviously would bias the average in a misleading way. But it is an excellent benchmark model for benchmarking future releases. The evaluation times involved for the PO5 model give a false the impression that this is a small model. In reality it is a substantial model in the same ballpark as the other benchmarks listed here. It contains 980 variables and several arrays and array operations involving hundreds of thousands of cells. It is probably also the most highly optimized-for-speed model I've encountered, optimized originally for Analytica 3.1, with few opportunities for improved algorithms, which accounts for its extreme speed.
The percent speed-up was calculated to compute how much more work Analytica 4.6 carries out in a fixed amount of time, computed as the ratio of timings minus 1. A 25% speed-up means that 4.6 completes 25% more computation per unit time. You can convert these to a fraction and add 1 for the "fold-speed-up" -- for example, the AT1 result of 136% shows that 4.6 was 2.36-fold faster (meaning it performs a little over twice as much work in the same amount of time).
There are many operations that can be benchmarked -- model load time, parse time. user-interface operations, time to produce a graph, data import or export time or bandwidth, etc. These benchmarks are all selected to measure only model evaluation time, beginning after a model has been fully loaded into memory.
The substantial fluctuation in the percent speed-up highlights the fact that the amount of speed-up varies greatly by model. I selected these models to be a good representative sample of real-life models, which I hope reflect an average as objectively as is possible. Based on these and with this caveat, the conclusion here is that Analytica 4.6 evaluates models about 66% faster than the previous release.