deep_sort icon indicating copy to clipboard operation
deep_sort copied to clipboard

Reduce number of loops in tracker

Open ZhiyuanChen opened this issue 4 years ago • 3 comments

Slightly increase spped by reducing two for loop to one

ZhiyuanChen avatar Apr 26 '20 07:04 ZhiyuanChen

@zyc-ai a comprehension list is faster than a loop

alexnguyen2201 avatar May 01 '20 18:05 alexnguyen2201

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

ZhiyuanChen avatar May 02 '20 17:05 ZhiyuanChen

a comprehension list is faster than a loop

It seems not in the case of Python https://stackoverflow.com/a/43677631/8791650.

I beg to diff, consider doing this instead

def square_sum4(numbers): return(sum([i**2 for i in numbers]))

kanasite avatar Nov 03 '20 03:11 kanasite