#5538 HIGH Retriag: Every python activity emits errors when starting.

Zarro Boogs per Child bugtracker at laptop.org
Wed Dec 19 11:03:25 EST 2007


#5538: Every python activity emits errors when starting.
---------------------+------------------------------------------------------
  Reporter:  cscott  |       Owner:  marco            
      Type:  defect  |      Status:  new              
  Priority:  high    |   Milestone:  Retriage, Please!
 Component:  sugar   |     Version:                   
Resolution:          |    Keywords:  review?          
  Verified:  0       |  
---------------------+------------------------------------------------------

Comment(by cscott):

 I will note that the gratuitious use of 'imports only at the top' is one
 of the reasons we have performance problems in sugar.  *Every* activity
 ends up importing *all* of sugar, whether it needs it or not.  Moving rare
 imports down to use sites is critical to recovering common-case
 performance.  This code is no less maintainable -- you *do* use a tool
 such as flymake or pylint to ensure that your variables are defined before
 use, don't you?

 My understanding is that the canonical specification of the Update.1
 process is at http://wiki.laptop.org/go/Update.1_process , and it doesn't
 mention 'Retriage, Please!' at all.  If it should, the wiki should be
 updated.

 My apologies for mixing the bits of #4909 in here; I meant to call that
 out specifically in my description above (I did mention it at bug #4909).

 Concrete performance numbers:
 {{{
 Pippy 'keep as activity': 8-9s, without patch, and spews errors to the
 output window. 6-7s, with patch.
 import sugar.activity.activity: 5.3s without patch. 0.85s with patch.
 import sugar.graphics.icon: 3.35s without patch. 0.76s with patch.
 import sugar.profile: .25s without patch, and spews an error to the log.
 .11s with patch.
 }}}

 Yes, it is true that at this point much of the savings can be eaten by the
 next import of some package I haven't touched here which itself imports
 transitively all of sugar.  But unless we start moving chunks of time from
 initialization to use, we will always be saddled with high startup times.

 I am nominating this bug for Update.1 because it has at least one very
 user-visible effects: it removes spurious (and confusing) messages from
 the console when Pippy 'saves as activity'.  The other developer-visible
 effect is that it fixes the confusing messages in the activity log dealing
 with 'failure to load pubkey', which have confused at least one person
 trying to debug a problem with an activity.  I would be happy to spin a
 smaller patch that addressed just those two issues while leaving the
 lion's share of the performance problems alone, but I believe we must make
 a start at solving our performance problems.

-- 
Ticket URL: <http://dev.laptop.org/ticket/5538#comment:8>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list