Open wmwv opened 6 years ago
astropy.cosmology.FlatLambdCDM(...).comoving_distance
calculates 10^6 distances from an array of redshifts in 13 s.
Using an elliptic integral approach in Python is ~10 faster. Takes 1 s for 10^6 distances.
After adopting Elliptic integration functions, the Go routines are 700 ns/distance calculated.
The base astropy.cosmology.FlatLambdaCDM(...).comoving_distance
is 13,100 ns/distance calculated.
The routine I wrote in Python using scipy.special.ellipkinc
is 300 ns/distance calculated.
So (a) there's a factor of 2 improvement likely possible in my current go implementation; and (b) I should submit a PR to AstroPy for speeding up the astropy.cosmology.FlatLambdaCDM(...).comoving_distance
calculation.