Gaincal access to visibilities speed up
Accessing the visibilities using casacore indexes causes a very expensive operation in the ok() method. Such method, among other things, checks the integrity of the array at each access.
Since the array is consecutive the pointer can be used to create a span speeding up the performances of a factor ~2.
This is the DP3 before the optimization
Total DP3 time 119.93 real 2611.46 user 118.48 system
1.1% ( 1351 ms) MSReader
95.5% ( 114 s) GainCal gaincal.
44.8% ( 51 s) of it spent in predict
51.9% ( 59 s) of it spent in reordering visibility data
2.3% ( 2591 ms) of it spent in estimating gains and computing residuals
0.0% ( 30 ms) of it spent in writing gain solutions to disk
Converged: 91, stalled: 9, non converged: 0, failed: 0
Iters converged: 6, stalled: 9, non converged: 0, failed: 0
2.9% ( 3467 ms) MSWriter msout.
3.4% ( 119 ms) Creating task
and this is after the optimization
Total DP3 time 65.06 real 964.02 user 133.96 system
2.1% ( 1344 ms) MSReader
92.2% ( 59 s) GainCal gaincal.
90.4% ( 54 s) of it spent in predict
2.6% ( 1553 ms) of it spent in reordering visibility data
4.5% ( 2684 ms) of it spent in estimating gains and computing residuals
0.0% ( 7 ms) of it spent in writing gain solutions to disk
Converged: 91, stalled: 9, non converged: 0, failed: 0
Iters converged: 6, stalled: 9, non converged: 0, failed: 0
4.7% ( 3083 ms) MSWriter msout.
0.3% ( 8 ms) Creating task
183.9% ( 5672 ms) Writing (threaded)
Edited by Mattia Mancini