1

I am looking for the fastest implementation of pairwise distance between two sets of vectors (two 2D arrays) in c++/python.

What have I done? I ran the code from here on my server. In python, I found that the pairwise distance function from scikit learn and cdist from scipy.special.distance have fastest pairwise distance implementation.

Question: Calculating pairwise distance is the major bottleneck of my program. Thus, I wanted to know if one compute pairwise distance faster if coded purely in C++ (given that a most of the underlying code in scikit-learn, scipy is in C++ )?

milbrandt
  • 1,438
  • 2
  • 15
  • 20
  • I am mainly looking for euclidian and manhattan distances. Thanks in advance! – Vivek Bagaria Feb 02 '18 at 12:41
  • 2
    This seems a bit broad. It is basically impossible to tell if a 2x speedup is possible because it requires the original implementation, benchmarking setup and hardware description. Since we have no information on any of those the chances of you getting a useful answer are very slim. Have you even checked if that algorithm is the bottleneck of your application? – nwp Feb 02 '18 at 13:05
  • @nwp: I have edited my question. Thanks :) – Vivek Bagaria Feb 03 '18 at 00:58

0 Answers0