Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Compiling it to PYC to reduce loading time. #22534
Comments
|
For some reason, it seems to have removed the asterisks in the "zip" command line. It should read {star}.pyc in each of the three places. |
|
Use lazy extractors. |
|
What does "use lazy extractors" mean? (I have no idea what you mean by that or why you closed the thread) |
|
Also, how do I "un-close" the thread? |
|
Hmmm. No response. Maybe moderators screwed up??? Anyway, how do I un-close this? |
|
You can't. |
|
OK. So I need to start a new thread. |
|
Probably not. There is some code for lazy loading in But this lead nowhere ahead so far. |
|
Generally, that would be true (that load time is small compared to download time). But my use of youtube-dl is primarily not for downloading, but only for "translating" "web-page" URL to "download" URL. Then I play the video via a player that can play URLs directly without downloading them. My general feeling is that the process takes about 10-15 seconds, and I think about 2/3 of that is the loading time. If I can get the loading time down from about 10 seconds to 5 seconds, that's a significant improvement. Stuff I've read on another support board indicates that if you install youtube-dl via "pip" instead of via direct download (and subsequent use of "-U"), you will get a pre-compiled version and that that version loads faster. However, since I don't understand what "pip" is or why it is worth learning about it, I prefer to stick with the method(s) I'm familiar with. |
Checklist
Question
WRITE QUESTION HERE
(Running under Linux - latest version (2019.09.28))
The version of youtube-dl that I've used for many years now comes as a ZIP file with the first line being "#!/usr/bin/env python". It works fine, but takes a while to load. I am looking to speed that up. I have a cron job that runs every morning (early) and does "youtube-dl -U". I mention this just to be clear that that's how I keep it up-to-date.
Here's what I have done - and it seems to work, but I have not tested throughly.
Is this OK? Or is there a better way to get a compiled version?
This all seems to work, and the resulting executable, while bigger (about 2.4M vs. about 1.7M) than the original, loads and runs faster (about 1.2 seconds vs. 5.4 seconds).