How? Initially, I tried to minimize where ever possible the calculations such as the following.
1.Computation of r (calculation per every data mark)
- float(mid([u],1,find([u],",")-1))^2+float(mid([u],find([u],",")+1))^2
- float(mid([u],1,[Position,]-1))^2+float(mid([u],[Position,]+1))^2
- ([Zoom]/2)*(index()-[points]-1)/([points])+[x0]
- [Zoom/(2*points)]*index()+[x00]
Same has been applied to the calculation of y.
3.Computation of the state variable u (computation at every data mark)
Note that the str([x])+","+str([y]) is a common term. We created a new field
The new viz can be found here.
For a couple of cases, the stats on running on Tableau Desktop 10.5.0 we got are as follows:
- 51x51 grid and 20 iterations: the consumed time improved from 24s to 8s. That's 3 to 1.
- 101x101 grid and 20 iterations: the improvement is from 96s to 33s. That's 2.9 to 1.
So we achieved about 3 times faster.
Later on, we examined the contribution of each of the 3 optimizations, the last one did the most. The other 2's contributions are negligible.
Conclusion
Performance of a viz has been a concern. The cause can be multiple. Here we just address the calculations. There are two categories of calculations we need to be wary of:
- Calculation per row of data
- Calculation per data mark
Think that if we have 1 millions of data marks or rows, one operation/row saved would 1 million operations saved for the viz. This can accelerate the rendering and make user experience a much better one. Or it allows us to visualize more data in the equivalent amount of time.
3.Computation of the state variable u (computation at every data mark)
Note that the str([x])+","+str([y]) is a common term. We created a new field
- [IniString]=str([x])+","+str([y])
The new viz can be found here.
For a couple of cases, the stats on running on Tableau Desktop 10.5.0 we got are as follows:
- 51x51 grid and 20 iterations: the consumed time improved from 24s to 8s. That's 3 to 1.
- 101x101 grid and 20 iterations: the improvement is from 96s to 33s. That's 2.9 to 1.
So we achieved about 3 times faster.
Later on, we examined the contribution of each of the 3 optimizations, the last one did the most. The other 2's contributions are negligible.
Conclusion
Performance of a viz has been a concern. The cause can be multiple. Here we just address the calculations. There are two categories of calculations we need to be wary of:
- Calculation per row of data
- Calculation per data mark
Think that if we have 1 millions of data marks or rows, one operation/row saved would 1 million operations saved for the viz. This can accelerate the rendering and make user experience a much better one. Or it allows us to visualize more data in the equivalent amount of time.
Add a comment