This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients corona10, miss-islington, pablogsal, petr.viktorin, phsilva, rhettinger, serhiy.storchaka, shihai1991, vstinner
Date 2021-04-11.01:20:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618104014.27.0.574774269911.issue40137@roundup.psfhosted.org>
In-reply-to
Content
Here are some benchmarks of using lru_cache in 3.9 and 3.10 (PGO/LTO/CPU isol):

❯ ./python -m pyperf timeit "from functools import lru_cache; f = lru_cache(lambda: 42)" "f()" --compare-to ../3.9/python
/home/pablogsal/github/3.9/python: ..................... 2.60 us +- 0.05 us
/home/pablogsal/github/cpython/python: ..................... 2.74 us +- 0.06 us

Mean +- std dev: [/home/pablogsal/github/3.9/python] 2.60 us +- 0.05 us -> [/home/pablogsal/github/cpython/python] 2.74 us +- 0.06 us: 1.06x slower

Given that lru_cache is normally used to seek speed, this is a bit unfortunate :(
History
Date User Action Args
2021-04-11 01:20:14pablogsalsetrecipients: + pablogsal, rhettinger, vstinner, phsilva, petr.viktorin, serhiy.storchaka, corona10, miss-islington, shihai1991
2021-04-11 01:20:14pablogsalsetmessageid: <1618104014.27.0.574774269911.issue40137@roundup.psfhosted.org>
2021-04-11 01:20:14pablogsallinkissue40137 messages
2021-04-11 01:20:14pablogsalcreate