catchmrbharath/sympy — comment on commit d63fbf91d22963cc13ef9030aade6650efa84726
File: sympy/combinatorics/permutations.py line 909
By pernici:

with this the old algorithm is a bit faster; in a benchmark I get that the new algorithm starts to get faster around n = 190
```
if len(a) < 190:
n = len(a)
for i in xrange(n - 1):
b = a[i]
for c in a[i + 1:]:
if b > c:
inversions += 1
```