mmomtchev/igc-xc-score

Possible speedup

Closed this issue · 2 comments

vicb commented

The algo currently optimize the score and the most expensive part is the computation of the distance.

Any win in the distance computation could result in a faster algo.

One thing to try would be to optimize score2 instead.

This would remove one expensive Math.sqrt() from each distance computation and it could be applied only once one the outptut.

edit: I don't think it's possible to optimize score2 but maybe there is still something to do with distance2

This comes down next to nothing, it used to be like this in the very early versions - it will break compatibility with vincenty's and it does not apply to maxDistancePath which is the most time-consuming one
If you do it only for the rest - the gain is inferior to the random variation across different runs

vicb commented

Thanks for the answer. Closing then.