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

zip better release #32849

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

zip better release #32849

wants to merge 1 commit into from

Conversation

tansy
Copy link

@tansy tansy commented Jul 11, 2024

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • [x ] I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • [ x ] Improvement
  • New extractor
  • New feature

Description of your pull request and other information

Explanation of your pull request in arbitrary form goes here. Please make sure the description explains the purpose and effect of your pull request and is worded well enough to be understood. Provide as much context and examples as possible.

It makes sense to compress release version the best possible as it is done only once and then decompressed many times over.
It also doesn't cost much - here, less than 0.25 s more during make.

@dirkf
Copy link
Contributor

dirkf commented Jul 11, 2024

The default compression is -6 which gives a 12% smaller than -1 for 30% more time (against the current codebase).

The trade-off for -9 is x2 CPU vs 7% better compression. This example shows why -6 was set to be the default.

But as far as I can tell there's no reason why you couldn't use the higher, or any, compression level in your builds, since all Python versions that we support have a compatible zlib module.

@tansy
Copy link
Author

tansy commented Jul 11, 2024

On ancient computer:

$ time make -f Makefile youtube-dl

real    0m2.048s
user    0m1.426s
sys     0m0.539s

$ time make -f Makefile-zip-9 youtube-dl

real    0m2.128s
user    0m1.781s
sys     0m0.274s

difference in time is, literally, blink of an eye.

Even decompression is faster. Slightly but it is.

Overall gain is small, but the cost is even smaller. It's imperceptible.

--
I'd like to take this opportunity to ask why is 'executable' (`youtube-dl' pyexe) included in source package (youtube-dl.tar.gz)? It's already generated as executable and then included in source. I guess noone is using it as a source but still, the question remains.

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

Successfully merging this pull request may close these issues.

2 participants