What's the best way to implement python cache for better performance? or How does python cache work a

18 Replies, 1761 Views

The real power of python cache is in recursive functions. Like, Fibonacci without caching is a nightmare.

But yeah, it’s easy to misuse. If your function isn’t deterministic, you’re in for a bad time.

Also, `lru_cache` doesn’t work with async functions. For that, you’ll need `async_lru` or similar.

Messages In This Thread



Users browsing this thread: 1 Guest(s)