Add comment to explain the implications of not sorting keywords (#3331) · python/cpython@5503709 · GitHub
Skip to content

Commit 5503709

Browse files
authored
Add comment to explain the implications of not sorting keywords (#3331)
In Python 3.6, sorted() was removed from _make_key() for the lru_cache and instead rely on guaranteed keyword argument order preservation. This makes keyword argument handling faster but it also causes multiple callers with a different keyword argument order to be cached as separate items. Depending on your point of view, this is either a performance regression (increased number of cache misses) or a performance enhancement (faster computation of keys).
1 parent 759e30e commit 5503709

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/functools.py

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)