| Summary: | RFE: Reduce startup time for "large" code bases | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | James Antill <james.antill> |
| Component: | python2 | Assignee: | Charalampos Stratakis <cstratak> |
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | bkabrda, cstratak, dmalcolm, ivazqueznet, jonathansteffan, jzeleny, mhroncok, pviktori, rkuska, tomspur, torsava |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-07 11:26:29 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Yeh, so, I didn't include a simpler test case (so it makes it hard to test pypy or py3k until yum works on either of those). So here: % cat pyinitspd.py class Foo: def blah(): return % for i in $(seq 30000); echo -e " def spdtst$i(): return" >> pyinittst.py % wc -l pyinitspd.py 30004 pyinitspd.py % time python -c 'import pyinitspd' python -c 'import pyinitspd' 0.60s user 0.06s system 97% cpu 0.670 total # This builds the .pyc file too. % time python -c 'import pyinitspd' python -c 'import pyinitspd' 0.14s user 0.03s system 98% cpu 0.171 total # This is a little slower than import yum, but meh. Amusingly, converting to "Foo(object)" class drops the time by 0.01 ... and this is repeatable. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component. This is a long-term goal upstream, and they're slowly working at it. Expect improvements in python3. |
Description of problem: Here is that bug you asked for ... basically certain yum operations are now fast enough that the python startup time hurts us quite a lot: % time sudo yum list installed yum --color=off Loaded plugins: PT, aliases, auto-update-debuginfo, keys, noop, ps, security, : tmprepo, updater, verify, versionlock Installed Packages yum.noarch 3.4.1-4.fc15 @fedora-yum-rawhide sudo yum list installed yum --color=off 0.18s user 0.05s system 95% cpu 0.236 total % time python -c 'import yum' python -c 'import yum' 0.12s user 0.03s system 97% cpu 0.155 total % time python -c 'pass' python -c 'pass' 0.02s user 0.01s system 91% cpu 0.040 total ...as I said, from the simple tests I'd done this seemed to be a python thing and not a yum thing ... as creating a single python file of 30k lines (that did no operations) took roughly the same amount of time for python to init.