Message244975
| Author |
serhiy.storchaka |
| Recipients |
georg.brandl, larry, python-dev, serhiy.storchaka, taleinat |
| Date |
2015年06月07日.21:36:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1433712984.71.0.630037257612.issue20186@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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))" |
|
History
|
|---|
| 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 |
|