diff options
author | 2024-04-29 16:47:36 -0700 | |
---|---|---|
committer | 2024-04-29 16:47:36 -0700 | |
commit | baae083e6093649a7a641eab7a972b65048e531d (patch) | |
tree | efc27bf5c6773422e175ff50be7a01989e2c95bf /python | |
parent | 24cd8c3756a7ef1c5b51e499430e22f645ef544e (diff) |
Compress precompiled python zips
When making this script deterministic we accidentally changed it so that
none of the entries in the output zip file were compressed. Re-add
the compression.
Adding the compression makes atest go from 67M to 34M, at the cost of
0.33s startup time instead of 0.28s.
Test: Presubmits
Change-Id: I4e58eb76235ddabf0195694cdd3644f26b7e84ec
Diffstat (limited to 'python')
-rw-r--r-- | python/scripts/precompile_python.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/python/scripts/precompile_python.py b/python/scripts/precompile_python.py index 07b8fe97b..b3cf950d9 100644 --- a/python/scripts/precompile_python.py +++ b/python/scripts/precompile_python.py @@ -30,6 +30,7 @@ def process_one_file(name, infile, outzip): # Date was chosen to be the same as # https://cs.android.com/android/platform/superproject/main/+/main:build/soong/jar/jar.go;l=36;drc=2863e4535eb65e15f955dc8ed48fa99b1d2a1db5 info = zipfile.ZipInfo(filename=name, date_time=(2008, 1, 1, 0, 0, 0)) + info.compress_type = zipfile.ZIP_DEFLATED if not info.filename.endswith('.py'): outzip.writestr(info, infile.read()) |