Use self-descriptive cache with type tags#20137
Conversation
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
hauntsaninja
left a comment
There was a problem hiding this comment.
Looks good from a skim.
Should we maybe keep version_id up front and read it first so that we can avoid format change issues?
It is a bit more nuanced than that, on one hand we have things like I am going to add something like this in a separate PR. |
JukkaL
left a comment
There was a problem hiding this comment.
Looks good! Glad to see that compiled performance isn't impacted much.
This should make our cache format more future proof w.r.t lazy deserialization and other features:
read_str()->read_str_bare()etc are C calls).Note that I now serialize various little arbitrary JSON blobs (like plugin data etc) using fixed format, since with the tags we can do this.