https://github.com/mongodb/mongo/blob/master/db/geo/core.h
The function spheredist_rad can be optimized in two ways:
1) use a faster (but correct) formula: take a loook to http://www.movable-type.co.uk/scripts/latlong.html
I would suggest the Spherical Law of Cosines, I've tested it and seems to work very well.
2) then use a function that calculate sin and cos at the same time (saving in this way half of trigonometric functions): for example on x86/x86_64 there are several options (standard fsincos assembly function, SSE2 optimizations)