On Oct 30, 2006, at 7:56 PM, John M Camara wrote:

>
> Below is a few lines from profiling a new quick start application.   
> All
> I did was create an app via quick start, modified the startup file to
> enable profiling, started the server, viewed the home page of the app,
> and then hit the browser refresh button 6 times.
>
> The line that starts with 23118 number of calls was the first item  
> that
> jumped out to me for investigation.  So I opened the code (listed
> next).  Now it seams a little absurd that it would be necessary to
> retrieve sys.modules 23118 times (takes 0.2 seconds) when TG starts  
> up.
>  The reloader_thread function monkey patches CherryPy and I have to be
> honest I didn't look into this particular issue any further as I
> started to look through other areas.

Actually, the first two things on the list seem far more interesting  
than the 0.2 seconds of requests for sys.modules.

My read on that is that if we handle the widget Kid templates in a  
lazier manner, we can shave several seconds off of the startup time.

> ==Begin Profile Data==
>          286628 function calls (280258 primitive calls) in 12.944 CPU
> seconds
>
>
>
>    Ordered by: internal time, call count
>
>
>
>    ncalls  tottime  percall  cumtime  percall filename:lineno 
> (function)
>
>        93    2.668    0.029    3.179    0.034 <string>:1(?)
>
>     86482    1.269    0.000    2.226    0.000
> \trentm\as\apps\activepython-devel\build\py2_4-win32-ix86\python 
> \modules\pyexpat.c:849(Default)
>
>        49    1.077    0.022    3.311    0.068
> g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:318 
> (_buildForeign)
>
>     86482    0.958    0.000    0.958    0.000
> g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py:434 
> (_default)
>
>   702/132    0.237    0.000    0.583    0.004
> g:\python24\lib\sre_parse.py:374(_parse)
>
>        48    0.230    0.005    0.230    0.005
> g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid 
> \template_util.py:2(?)
>
>        48    0.224    0.005    0.541    0.011
> g:\python24\lib\site-packages\kid-0.9.1-py2.4.egg\kid\__init__.py:9(?)
>
>     23118    0.202    0.000    0.202    0.000
> g:\python24\lib\site-packages\turbogears-1.0b1-py2.4.egg\turbogears 
> \startup.py:49(<lambda>)
> ==End Profile Data==



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to