Commit 9393c22
authored
Reduce size of JSON data in Mypy cache (#14808)
By default, Python outputs spaces after commas and colons when dumping
JSON data. This is normally fine, but when exporting large amounts of
JSON (such as cache info) it is more space efficient to export JSON
without whitespaces. To do this, simply pass `separators=(",", ":")` to
`json.dumps()`.
Although the space savings aren't massive, they do reduce the size of
the cache folder by a couple of megabytes:
| Method | Size |
|---------|--------|
| Current | 31.2MB |
| This PR | 29.3MB |
For comparison, the size of the cache folder with the `--sqlite-cache`
option is about 27.5MB.1 parent dc5ff29 commit 9393c22
2 files changed
+8
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
| 922 | + | |
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| |||
1055 | 1055 | | |
1056 | 1056 | | |
1057 | 1057 | | |
1058 | | - | |
| 1058 | + | |
| 1059 | + | |
1059 | 1060 | | |
1060 | 1061 | | |
1061 | 1062 | | |
| |||
1487 | 1488 | | |
1488 | 1489 | | |
1489 | 1490 | | |
1490 | | - | |
| 1491 | + | |
1491 | 1492 | | |
1492 | 1493 | | |
1493 | 1494 | | |
| |||
1517 | 1518 | | |
1518 | 1519 | | |
1519 | 1520 | | |
1520 | | - | |
| 1521 | + | |
1521 | 1522 | | |
1522 | 1523 | | |
1523 | 1524 | | |
| |||
3639 | 3640 | | |
3640 | 3641 | | |
3641 | 3642 | | |
3642 | | - | |
| 3643 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| |||
0 commit comments