Message236696
> Maybe we want a facility to create on-stack static-size tuples?
There is no guarantee that called function doesn't save the reference to args.
> How many functions can benefit from this approach, though?
From hand-writing caching? Any function, that repeatedly call other functions many times. In additional to sorted()/list.sort() with the key argument, filter() and map(), these are min() and max() with the key argument, some iterators from itertools (groupby(), dropwhile(), takewhile(), accumulate(), filterfalse()). May be some functions that are thin wrappers around special method (e.g. round()).
But it is more interesting to investigate why PyTuple_New() is so slow in comparison with hand-written caching. It it can be speeded up, then mauch more code can benefit from this. |
|
Date |
User |
Action |
Args |
2015-02-26 18:21:06 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, pitrou, scoder, ezio.melotti |
2015-02-26 18:21:06 | serhiy.storchaka | set | messageid: <1424974866.64.0.671805876328.issue23507@psf.upfronthosting.co.za> |
2015-02-26 18:21:06 | serhiy.storchaka | link | issue23507 messages |
2015-02-26 18:21:06 | serhiy.storchaka | create | |
|