You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python 2 typing.py needs to cache generics too #290
In #283 we added a cache to things like List[str] that gives two orders of magnitude speedup. But the cache is only Python 3. We should add this to Python 2 as well. (Sadly the Python 2 stdlib doesn't have functools.lru_cache.)
FWIW A super-basic cache similar to the one used by re.compile() should work fine. Instead of maintaining an LRU data structure, it just erases the entire cache when max-cache is reached. The calculations we did in #283 (comment) suggest that a cache size of 128 should be a good start.
Activity
gvanrossum commentedon Oct 4, 2016
FWIW A super-basic cache similar to the one used by
re.compile()should work fine. Instead of maintaining an LRU data structure, it just erases the entire cache when max-cache is reached. The calculations we did in #283 (comment) suggest that a cache size of 128 should be a good start.Add a (somewhat simple-minded) cache to the Python 2 version too. (#291)