Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b266dd1

Browse files
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

7 files changed

+277
-176
lines changed

mypy-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ typing_extensions>=4.6.0
44
mypy_extensions>=1.0.0
55
pathspec>=0.9.0
66
tomli>=1.1.0; python_version<'3.11'
7-
librt>=0.2.1
7+
librt>=0.3.0

0 commit comments

Comments
 (0)