Fixed performance bottleneck in pysudo