I found that the rescale to compute the median was increasing the cost of the distance marginalized likelihood by a significant amount, this will cache that computation.