Mailinglist Archive: opensuse-factory (381 mails)

< Previous Next >
[opensuse-factory] Re: [opensuse-packaging] Proposal to remove pyc/pyo from Python on TW
  • From: Alberto Planas Dominguez <aplanas@xxxxxxx>
  • Date: Fri, 05 Oct 2018 10:38:10 +0200
  • Message-id: <2559795.TkZaimm0aq@lena>
On Thursday, October 4, 2018 6:04:27 PM CEST Neal Gompa wrote:

I've heard variations of this theme for almost a decade now. There are
three major problems with this:

* Python is _very_ slow without the cache, and generating the cache is
a slow operation. This is a terrible penalty for systems that heavily
rely on Python. And failure to write the cache means every run is
fully interpreted and very slow.

But in the proposal there is a cache, only that living in a different place.
Also you are wrong believing that Python will not generate the pyc if is not
there, as they will reside in memory. Python can only execute pycs, so the
speed is exactly the same. The penalty is only the first time that pyc is
generated.

* Generating the bytecode on the system means that we aren't
evaluating the code to check whether it actually works for the target
Python at build-time. This is a huge problem for ensuring the code is
actually compatible with the target version of Python. While it's of
course possible to have some things slip by, even with bytecode
generation, it's a lot less likely.

Actually no, as the pyc will be generated on OBS just when the %check happens.
The proposal is not integrating those pyc in the RPM.

* It makes it much more likely that we'll leave garbage on the
filesystem with installs and uninstalls of Python software. That just
adds up to unaccounted space being taken up for relatively static
content that should be pre-generated and tracked.

That is true, but is true for any cache management. This can be cleaned
regularly or thing about a new macro that will make sure that the pyc for the
upgraded module is not there anymore. Or not do anything and delegate it to
the normal management of any server.

OpenMandriva went with this approach for a while, and they're
switching back because of these issues, especially as they've become
more aggressive about upgrading the Python stack and keeping modules
up to date since they switched /usr/bin/python to point to Python 3.

Note that the proposal is backporting a new feature from 3.8 that will enable
the living of the pyc files in a different place. I am not sure how
OpenMandriva implemented this feature.

--
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham
Norton, HRB 21284 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany


--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >