lru_cache for all type