Commit b266dd1
authored
Use fixed format for cache metas (#20088)
This makes cache meta files ~1.5x smaller. (I hoped together with
previous diff it will give us 4x, but it is more like 3x).
Implementation is mostly straightforward, here are some comments:
* I make `CacheMeta` a regular class, it doesn't need to be immutable
IMO (since we actually mutate it in few places).
* I remove all uses of untyped dicts in favour of `CacheMeta` (note this
might make JSON format slightly slower actually, but difference is below
noise level)
* Instead of manually checking some individual keys, I use blanket
`try/except (KeyError, ValueError)` when deserializing metas.
* In one place (where we update meta file after _read_), I update the
loaded view to match the updated file 1:1. This should be more robust.
* I still use JSON dumps for options and plugins snapshots. Serializing
these using FF is tricky (and will be simpler with type tags).
* I rename `data_json`/`meta_json` paths to `data_file`/`meta_file`
everywhere.1 parent 583c5f7 commit b266dd1
File tree
7 files changed
+277
-176
lines changed- mypyc/codegen
- mypy
7 files changed
+277
-176
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
0 commit comments