import functools
import time
@functools.lru_cache(maxsize=256)
def find_user(name):
# imitating slow search
time.sleep(1)
user = {"id": 11, "name": "Diane"}
return user
find_user("Diane")
# kinda slow
find_user("Diane")
# blazingly fast