You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on optimizing some data-heavy internal pipelines, I noticed an interesting pattern regarding how we handle function caching and memoization across various utilities.
Currently, developers frequently reach for external packages or write custom lightweight decorators when dealing with transient caching needs, even though functools.lru_cache is robust and built right into the standard library. However, functools.lru_cache can sometimes feel a bit rigid for modern asynchronous code, or when dealing with automatic cache invalidation, memory footprint limits without fixed bounds, or TTL (Time-To-Live) constraints without pulling in heavy third-party dependencies like cachetools.
I wanted to open a discussion on whether there's any appetite in the community or core development team to:
Expand or modernize some of the existing caching primitives within functools (e.g., native TTL support or memory-bounded variants that don't require manual maxsize tuning).
Document or recommend standard idioms for common memoization patterns that bridge the gap between simple one-offs and full-scale caching frameworks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
While working on optimizing some data-heavy internal pipelines, I noticed an interesting pattern regarding how we handle function caching and memoization across various utilities.
Currently, developers frequently reach for external packages or write custom lightweight decorators when dealing with transient caching needs, even though
functools.lru_cacheis robust and built right into the standard library. However,functools.lru_cachecan sometimes feel a bit rigid for modern asynchronous code, or when dealing with automatic cache invalidation, memory footprint limits without fixed bounds, or TTL (Time-To-Live) constraints without pulling in heavy third-party dependencies likecachetools.I wanted to open a discussion on whether there's any appetite in the community or core development team to:
functools(e.g., native TTL support or memory-bounded variants that don't require manual maxsize tuning).All reactions