My test case is: f = [x^2 for x in l if (x % 2) == 0] (and something similar with map and filter)
(where you read x^2 please consider x(double asterisk)2)
For 500k elements - xrange(500000) - this takes: 0.122527122498 (list comprehension) 0.145442008972 (map/filter)
My test case is: f = [x^2 for x in l if (x % 2) == 0] (and something similar with map and filter)
(where you read x^2 please consider x(double asterisk)2)
For 500k elements - xrange(500000) - this takes: 0.122527122498 (list comprehension) 0.145442008972 (map/filter)