How to efficiently calculate pairwise differences between values in a list (tensor)?

This post helped me to reach a solution, however it is still 7x slower than pdist (which is a similar and a little more complex operation, but not what I need):

I have put more details here, in case anyone is interested reading or answering there: