Why is in my case For loop faster vs Map, Reduce and List comprehension
问题 I wrote a simple script that test the speed and this is what I found out. Actually for loop was fastest in my case. That really suprised me, check out bellow (was calculating sum of squares). Is that because it holds list in memory or is that intended? Can anyone explain this. from functools import reduce import datetime def time_it(func, numbers, *args): start_t = datetime.datetime.now() for i in range(numbers): func(args[0]) print (datetime.datetime.now()-start_t) def square_sum1(numbers):