googleapis / googleapis/google-api-python-client

Compressing the discovery cache

オープン
#2,321 コメント 8 件 リアクション 9 件 担当者 0 名 GitHub で見る
priority: p3 type: feature request
主要言語
Python
スター
8.9k
フォーク
2.6k
平均マージ
2日 28分
マージ済み PR(30日)
17

説明

#2315 shaved off a bit more than 20MB of the discovery cache, by removing the json indentation.
Currently there's still 74.6MB remaining, and it appears to be growing steadily over time (from 81MB on 2023-03-31 to 94MB on 2024-01-15).

So while #2315 definitely helped, I believe that it's a good idea to consider reducing the size even further. I believe that this could significantly improve build/deploy times of the many docker images that use this library. For reference, the current latest [`python-slim`](https://hub.docker.com/_/python/tags) docker image is less than 50MB.

An easy win would be to use compression.
To illustrate: if I manually zip the entire `documents` directory of 74.6MB in v2.114.0 using the pop-os default [gnome archive manager](https://gitlab.gnome.org/GNOME/file-roller), I end up with an archive of 11.9MB.
Creating a `documents.tar.xz` in the same way makes this 4.6MB.

It should be possible to achieve similar levels of compression by using Python's standard compression libraries, e.g. [`zlib`](https://docs.python.org/3/library/zlib.html), [`zipfile`](https://docs.python.org/3/library/zipfile.html), or [`lzma`](https://docs.python.org/3/library/lzma.html).

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。