Bug 713927 - RFE: Reduce startup time for "large" code bases
Summary: RFE: Reduce startup time for "large" code bases
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: python2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Charalampos Stratakis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-16 19:22 UTC by James Antill
Modified: 2017-08-07 11:26 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-07 11:26:29 UTC
Type: ---


Attachments (Terms of Use)

Description James Antill 2011-06-16 19:22:51 UTC
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.

Comment 1 James Antill 2012-07-05 16:17:31 UTC
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.

Comment 2 James Antill 2012-07-05 16:19:35 UTC
 Amusingly, converting to "Foo(object)" class drops the time by 0.01 ... and this is repeatable.

Comment 3 Fedora Admin XMLRPC Client 2013-05-10 04:58:26 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora Admin XMLRPC Client 2015-05-12 12:01:48 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora Admin XMLRPC Client 2016-01-29 13:04:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 6 Fedora Admin XMLRPC Client 2017-01-10 18:48:45 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Petr Viktorin 2017-08-07 11:26:29 UTC
This is a long-term goal upstream, and they're slowly working at it.
Expect improvements in python3.


Note You need to log in before you can comment on or make changes to this bug.