-
Notifications
You must be signed in to change notification settings - Fork 61
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
Python execution very slow #461
Comments
@ricardosalveti pointed me to the relevant OSTree issue: |
Interesting... There is a relevant new feature in uptstream python (https://bugs.python.org/issue33499) but you'd have to wait a bit to appear here. Then, the easiest but imperfect fix would be to make it refer to a temporary directory so that it would at least be cached between runs. Theoretically it could be back-ported and used on current versions but it probably requires some non-trivial effort + maintenance overhead. Failing that, working on a solution with ostree maintainers seems like the best way to go. |
Part of it (judging from the logs) looks to be due to |
@lbonn it seems that OSTree tries to push that to its users, see cgwalters comment:
The Python community is working on a solution for reproducible builds, however this is available in Python 3.7 and newer only: https://www.python.org/dev/peps/pep-0552/ It allows use hash based comparison whether a source file has been changed. Timestamp will still be the default, so we would have to opt for the hash based (or the unchecked hash) mechanism then. |
One way to work around is to just set the timestamp in the Another option would be to just not deploy the |
That would be nice to see as well. |
Just realized that thanks to the reproducible build effort OpenEmbedded core actually already carries a patch which allows to use I think with this we just need to make sure to set |
My first try was adding a
This works for the core libraries. However, all libraries (e.g. I then tired setting
I am not sure why With that, I have 0 bytecode warnings, and However, this is not ideal since we cannot easily alter At this point we might as well just use reproducible builds for the whole rootfs. There are probably even more advantages: E.g. currently, when clearing tmp/sstate and rebuilding, the resulting OSTree contains a lot of differences to the earlier version, just due to timestamp etc. So for OSTree, using reproducible builds also helps keeping the deltas small even when not reusing sstate... |
I like the sound of that! What are the drawbacks to that approach? I haven't read up on the topic in a while. |
@patrickvacek @agners |
@OYTIS yeah OE/Yocto documentation is lacking in that domain. From how I understand
I guess we could put this into |
@agners Thank you. I'm totally for it. But the problem with python eggs is still going to stay as far as I understand. And we can't set |
@OYTIS yes, however, I think that egg generation is totally unnecessary. I sent a patch removing it upstream: http://lists.openembedded.org/pipermail/openembedded-devel/2019-January/198220.html Still, if there is a recipe which needs to pack some stuff into a zip file, we might run into troubles again. So I'd rather prefer to have OSTree supporting other timestamps than 0... |
Python scripts/programs appear to be very slow. Already running the Python interpreter is slower than usual. Using
python3 -v
shows that Python detects the bytecode files (pyc) as stale:The text was updated successfully, but these errors were encountered: