我正在与谷歌或工具VRP与时间窗实施工作。我想激活缓存来加快速度。我有Python3.7.4,所以我可以使用@lru_cache。升级到python 3.9并使用@cache是否值得?
谢谢!
发布于 2021-11-22 20:53:08
看一下source code,它就是这样做的:
def cache(user_function, /):
'Simple lightweight unbounded cache. Sometimes called "memoize".'
return lru_cache(maxsize=None)(user_function)https://stackoverflow.com/questions/70071759
复制相似问题