As described in this post, KNN is pretty slow with custom metric written in pure python. I rolled out my own custom metric written in Cython, but it is still very slow.