Opened 5 years ago
Closed 4 years ago
#58638 closed enhancement (fixed)
port:youtube-dl : upgrade and performance improvement
Reported by: | RJVB (René Bertin) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | haspatch | Cc: | ryandesign (Ryan Carsten Schmidt) |
Port: | youtube-dl |
Description
This started out when I noticed that youtube-dl
is a zipped "script bundle" which means that it has to be inflated and byte-compiled on each and every invocation. That takes a noticeable amount of time, even on a faster machine. Testing shows that startup time becomes roughly 4x shorter when you install the application as a regular, uncompressed set of python scripts, of which bytecode can be cached.
The patch introduces a +unpacked variant which creates such an install. It takes a post-destroot approach, inflating the actual script, in order to ensure that the exact same code will be executed. In-app upgrades are impossible with this kind of install so there is no need to disable them via a hack.
I propose to drop the compulsory use of a MacPorts Python interpreter; the system one does just fine. The proposed +stock variant creates an install that is the pure stock version. I see no hard reason to ban in-app upgrades for such an install (the script will replace itself), leaving a backdoor for people who somehow need the latest versions *now*.
The upgrade to the current version is almost an afterthought :)
Attachments (1)
Change History (4)
Changed 5 years ago by RJVB (René Bertin)
comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)
comment:2 Changed 5 years ago by RJVB (René Bertin)
I don't know if the developer is aware of the implications of zipping the script but I cannot imagine he is not. The various instructions for building, installing and running do not give the impression he considers that the zipped version is the only way to go.
comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to RJVB:
I was aware that it is zipped, but I was not aware of the implications you mentioned. Do you know whether the developer of youtube-dl is aware of these implications and if so what his position on this is?
If unpacking the script has the advantages you claim, we should always do so; we should not make it a user choice via a variant.
I would say no. Apple has stated that future versions of macOS will not ship with scripting language interpreters. We should move our ports in a direction that will accommodate that change, by ensuring we always use MacPorts scripting language interpreters.
I don't want to change the fact that I ban in-app upgrades. We don't want anything other than MacPorts to install files that MacPorts ports install.
That should be done separately.