#5452 HIGH 8.2.0 (: Beat XP in activity startup time.
Zarro Boogs per Child
bugtracker at laptop.org
Sun Jul 6 22:20:03 EDT 2008
#5452: Beat XP in activity startup time.
-------------------------+--------------------------------------------------
Reporter: cscott | Owner: cjb
Type: defect | Status: new
Priority: high | Milestone: 8.2.0 (was Update.2)
Component: distro | Version:
Resolution: | Keywords:
Next_action: never set | Verified: 0
Blockedby: | Blocking:
-------------------------+--------------------------------------------------
Changes (by mtd):
* next_action: => never set
Comment:
I'm getting closer to tomeu's perspective on this. Attaching a file that
will do the lazy importing...now if we could only figure out where to put
it :).
I've had a play with sugar-toolkit/activity/activity.py and Terminal-
activity/terminal.py and I don't think we're going to get more than a
second or so out of lazy importing.
To use, here's an example of some changes to terminal.py that I tried:
{{{
import time
t0 = time.time()
from lazyimport import lazyModule
os = lazyModule('os') # import os
logging = lazyModule('logging') # import logging
from gettext import gettext as _
gtk = lazyModule('gtk') # import gtk
dbus = lazyModule('dbus') # import dbus
from sugar.activity import activity
from sugar import env
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.palette import Palette
import ConfigParser
import os.path
vte = lazyModule('vte') # import vte
pango = lazyModule('pango') # import pango
t1 = time.time()
logging.debug("terminal.py: imports took %s secs" % (t1 - t0))
}}}
--
Ticket URL: <http://dev.laptop.org/ticket/5452#comment:7>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system
More information about the Bugs
mailing list