Skip to content

Python 2 typing.py needs to cache generics too #290

Closed

Description

@gvanrossum

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.)

CC: @ilevkivskyi @gnprice

Activity

  1. added this to the 3.5.3 milestone on Oct 4, 2016
  2. gvanrossum commented on Oct 4, 2016

    @gvanrossum
    MemberAuthor

    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.

  3. self-assigned this
    on Oct 4, 2016
  4. added a commit that references this issue on Oct 5, 2016
    2dbf3fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions