improved the parallel computation of distances
profiling (yak shaving)