Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.54.0 package is larger than 2.53.0 #27957

Open
jiasli opened this issue Dec 1, 2023 · 2 comments
Open

2.54.0 package is larger than 2.53.0 #27957

jiasli opened this issue Dec 1, 2023 · 2 comments
Assignees

Comments

@jiasli
Copy link
Member

jiasli commented Dec 1, 2023

This size increase is observed on MSI and DEB:

# MSI
$ curl --head https://azcliprod.blob.core.windows.net/msi/azure-cli-2.53.0-x64.msi --no-progress-meter | grep Content-Length
Content-Length: 54837248

$ curl --head https://azcliprod.blob.core.windows.net/msi/azure-cli-2.54.0-x64.msi --no-progress-meter | grep Content-Length
Content-Length: 69832704

# DEB
$ curl --head https://packages.microsoft.com/repos/azure-cli/pool/main/a/azure-cli/azure-cli_2.53.0-1~jammy_amd64.deb --no-progress-meter | grep Content-Length
Content-Length: 52153106

$ curl --head https://packages.microsoft.com/repos/azure-cli/pool/main/a/azure-cli/azure-cli_2.54.0-1~jammy_amd64.deb --no-progress-meter | grep Content-Length
Content-Length: 65603516

RPM packages are not affected:

# RPM
$ curl --head https://packages.microsoft.com/rhel/9.0/prod/Packages/a/azure-cli-2.53.0-1.el9.x86_64.rpm --no-progress-meter | grep Content-Length
Content-Length: 33811125

$ curl --head https://packages.microsoft.com/rhel/9.0/prod/Packages/a/azure-cli-2.54.0-1.el9.x86_64.rpm --no-progress-meter | grep Content-Length
Content-Length: 33838159

Not sure if this is caused by #26749.

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 1, 2023

Thank you for opening this issue, we will look into it.

@bebound
Copy link
Contributor

bebound commented Dec 4, 2023

In Windows, the CLI2 folder size is 218MB in version 2.53.0 and increases to 305MB in version 2.54.0.
While Python3.11 binary slightly enlarges the overall size, the significant change occurs in site-packages(200MB -> 281MB).

  /mnt/c/Users/hanglei/Downloads/CLI 2.53.0/Lib/site-packages
 139.2M azure/                                      [=======================================================]
  14.6M pythonwin/                                  [=====                                                  ]
   7.5M pip/                                        [==                                                     ]
   6.9M cryptography/                               [==                                                     ]
   4.0M win32/                                      [=                                                      ]
   3.3M pygments/                                   [=                                                      ]
   2.5M pymsalruntime/                              [                                                       ]
   2.4M win32comext/                                [                                                       ]
   1.9M setuptools/                                 [                                                       ]
   1.1M github/                                     [                                                       ]
   1.1M win32com/                                   [                                                       ]
 812.0K pywin32_system32/                           [                                                       ]
 780.0K psutil/                                     [                                                       ]
 688.0K invoke/                                     [                                                       ]
 636.0K paramiko/                                   [                                                       ]
  /mnt/c/Users/hanglei/Downloads/CLI 2.54.0/Lib/site-packages
 210.7M azure/                                      [=======================================================]
  15.2M pythonwin/                                  [===                                                    ]
   7.6M pip/                                        [=                                                      ]
   7.3M cryptography/                               [=                                                      ]
   4.6M win32/                                      [=                                                      ]
   4.1M pygments/                                   [=                                                      ]
   2.9M setuptools/                                 [                                                       ]
   2.7M win32comext/                                [                                                       ]
   2.5M pymsalruntime/                              [                                                       ]
   1.6M github/                                     [                                                       ]
   1.4M win32com/                                   [                                                       ]
   1.4M psutil/                                     [                                                       ]
   1.0M invoke/                                     [                                                       ]
 948.0K paramiko/                                   [                                                       ]
 889.0K pkg_resources/                              [                                                       ]
 812.0K pywin32_system32/                           [                                                       ]
 748.0K jinja2/                                     [                                                       ]
 709.0K pyreadline3/                                [                                                       ]
 678.0K oauthlib/                                   [                                                       ]
 641.0K nacl/                                       [                                                       ]
 596.0K pycparser/                                  [                                                       ]

The cause of this issue is that the file size of .pyc files have significantly increased in Python 3.11

Python 3.11 made .pyc files almost twice as large. There are two main reasons for this:

PEP 659 made the bytecode stream ~3x as large as 3.10.
PEP 657 made the location tables ~9x as large as 3.10. ---python/cpython#99554

For example, paramiko and PyGithub remain the same version but the size grows about 50%.

Python 3.12 might alleviate this issue.

PS: duc is a nice tool for displaying folder sizes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants