#7959 NORM 8.2.0 (: gettext translations slows journal's scrolling

Zarro Boogs per Child bugtracker at laptop.org
Mon Aug 18 06:46:49 EDT 2008


#7959: gettext translations slows journal's scrolling
---------------------------+------------------------------------------------
   Reporter:  riccardo     |       Owner:  marco               
       Type:  enhancement  |      Status:  new                 
   Priority:  normal       |   Milestone:  8.2.0 (was Update.2)
  Component:  sugar        |     Version:  not specified       
 Resolution:               |    Keywords:  performance, r?     
Next_action:  review       |    Verified:  0                   
  Blockedby:               |    Blocking:                      
---------------------------+------------------------------------------------

Comment(by tomeu):

 {{{
 _i18n_timestamps_cache = {}
 }}}

 The number of cached entries is limited but can be pretty large, what
 about using a LRU cache? We have an implementation in the same module
 (util.py) and icon.py uses it.

 {{{
 query_args = ''.join((os.environ['LANG'], name_singular,
 }}}

 I think we should use locale.get_locale() instead of os.environ['LANG'].

 {{{
 try:
     time_period += _i18n_timestamps_cache[query_args]
 except:
 }}}

 I'd prefer if we checked like this "if query_args in
 _i18n_timestamps_cache:" instead of catching an exception.

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


More information about the Bugs mailing list