Closed bschoun closed 5 years ago
The previous version of the pgm2distance function used nested for loops, and took ~0.5s to run on my laptop. By vectorizing this function, the run time is improved to ~0.00056s, almost a 1000x speedup. It's also shorter and easier to read.
Great, thanks!
The previous version of the pgm2distance function used nested for loops, and took ~0.5s to run on my laptop. By vectorizing this function, the run time is improved to ~0.00056s, almost a 1000x speedup. It's also shorter and easier to read.