Message244975
The operator module is rarely used in the stdlib, but if it is used in user code (mainly with map(), reduce() or like) the performance often is important. You can use microbenchmarks like following (operator.add is twice faster than lambda x, y: x + y).
./python -m timeit -s "import operator; a = list(range(10000)); b = a[:]" -- "list(map(operator.add, a, b))" |
|
Date |
User |
Action |
Args |
2015-06-07 21:36:24 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, georg.brandl, taleinat, larry, python-dev |
2015-06-07 21:36:24 | serhiy.storchaka | set | messageid: <1433712984.71.0.630037257612.issue20186@psf.upfronthosting.co.za> |
2015-06-07 21:36:24 | serhiy.storchaka | link | issue20186 messages |
2015-06-07 21:36:24 | serhiy.storchaka | create | |
|