| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
If PyTuple_Pack() is "inefficient", I would prefer to have a specialized PyTuple_Pack2() function (or PyTuple_MakePair()) rather than having to use the generic PyTuple_FromArray(). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Benchmark:
import pyperf runner = pyperf.Runner() setup=""" d = {ii: ii+1 for ii in range(200)} dct_items = d.items() """ runner.timeit(name="extend list with dict keys", stmt="l = []; l += d", setup=setup) runner.timeit(name="extend list with dict items", stmt="l = []; l += dct_items", setup=setup)Results:
The benchmark is 19% faster (extend list with dict keys is a control benchmark).