Improve performance with Python's lru_cache decorator, which stores function results to avoid redundant expensive calculations for repeated calls.