Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reduce size of JSON data in Mypy cache#14808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 1 commit intopython:masterfromdosisod:minify-json-cache
Mar 1, 2023

Conversation

@dosisod
Copy link
Contributor

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 passseparators=(",", ":") tojson.dumps().

Although the space savings aren't massive, they do reduce the size of the cache folder by a couple of megabytes:

MethodSize
Current31.2MB
This PR29.3MB

For comparison, the size of the cache folder with the--sqlite-cache option is about 27.5MB.

By default, Python outputs spaces after commas and colons when dumping JSONdata. This is normally fine, but when exporting large amounts of JSON (such ascache info) it is more space efficient to export JSON without whitespaces. Todo this, simply pass `separators=(",", ":")` to `json.dumps()`.Although the space savings aren't massive, they do reduce the size of the cachefolder 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` optionis about 27.5MB.
@github-actions
Copy link
Contributor

According tomypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstraJelleZijlstra merged commit9393c22 intopython:masterMar 1, 2023
@dosisoddosisod deleted the minify-json-cache branchMarch 1, 2023 20:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@dosisod@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp