[Trac #530] modules that compile regex import slowly

Zarro Boogs per Child bugtracker at laptop.org
Sun Dec 3 12:36:06 EST 2006


#530: modules that compile regex import slowly
--------------------+-------------------------------------------------------
 Reporter:  ywwg    |       Owner:  blizzard
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:  BTest-2 
Component:  distro  |    Keywords:          
--------------------+-------------------------------------------------------
 I've been doing some profiling on PenguinTV on BTest-1, and found an
 interesting result.  Of the 30 seconds it takes to start PenguinTV, 8
 seconds of this time is in sre.py:213 (_compile).

 I load urlparse, HTMLParser, and some other modules that also do a lot of
 regex compiling, and they are contributing greatly to my startup time.
 I've been able to improve the sitation by moving the import statements
 around in the source files so that they are only called right before the
 module is needed, but this is also something that should be looked at.

-- 
Ticket URL: <http://dev.laptop.org/ticket/530>
One Laptop Per Child <http://laptop.org/>



More information about the Bugs mailing list