Slow "import hippo" and other on web browser activity startup

William Cohen wcohen at redhat.com
Mon Apr 9 18:53:26 EDT 2007


Hi all,

I was taking a closer look at where the startup time was spent when starting the 
web browser activity.  The profile from python profiler looks like the following:

import pstats
p = pstats.Stats('/tmp/pywebprof')
p.sort_stats('time').print_stats(10)


Mon Apr  9 18:19:30 2007    /tmp/pywebprof

          11141 function calls (11070 primitive calls) in 20.860 CPU seconds

    Ordered by: internal time
    List reduced from 802 to 10 due to restriction <10>

    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
         1    5.320    5.320    5.320    5.320 :0(browser_startup)
         1    4.360    4.360    7.650    7.650 :0(main)
         1    2.930    2.930    4.300    4.300 
/usr/share/activities/Web.activity/webactivity.py:17(?)
         1    1.390    1.390    2.320    2.320 :0(present)
         1    0.970    0.970    1.130    1.130 
/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py:23(?)
         1    0.340    0.340    0.380    0.380 /usr/lib/python2.4/socket.py:43(?)
        29    0.200    0.007    0.200    0.007 :0(lookup_icon)
        12    0.150    0.012    0.310    0.026 
/usr/lib/python2.4/ConfigParser.py:415(_read)
        24    0.130    0.005    0.130    0.005 :0(type_register)
       327    0.130    0.000    0.130    0.000 :0(lower)


According to the profile the "import hippo" is taking a couple of seconds. I 
tried it from an interactive python command line and it does seems to take a 
while (2 or 3 seconds). Why does the import take so long?

Where is the code for browser_startup, main and present to be found?

-Will



More information about the Devel mailing list