On Tue, Jul 28, 2009 at 09:37:56PM -0400, Stef Telford wrote:
>    Here is the output from the lowlevel connection select as you  
> suggested above (mostly) ordered by internal time. Note that it selects  

   Thank you!

> all 220k bookings, as opposed to last time when it 'only' selected 40k.  
> It seems that decimal.__new__ is killer .. I could be reading this wrong  
> (of course) but.. the tottime would seem to back that up I think.

   It's the point that I wanted to prove, really - to time fetchall and
Decimal without SQLObject.

>         133167599 function calls (133165268 primitive calls) in 392.615  
> CPU seconds
>
>   Ordered by: internal time

>   ncalls  tottime  percall  cumtime  percall filename:lineno(function)

>        1   16.715   16.715  392.589  392.589 t.lowlevel:3(<module>)

   This is the entire script - 392 seconds.

>        1   53.209   53.209  295.902  295.902 {method 'fetchall' of  
> 'psycopg2._psycopg.cursor' objects}

   295 seconds in the most interesting part of the program.

>  9883851   90.187    0.000  242.693    0.000 decimal.py:515(__new__)

   243 seconds were spent in Decimal.__new__. I.e., Decimal.__new__ is
called from DB API driver; so we can trust the profiler when it shown us
last time .to_python() calls were fast - they were really fast 'cause they
didn't have a need to call Decimal.

>  9883845   35.014    0.000   42.012    0.000 decimal.py:830(__str__)
>  9883845   21.096    0.000   63.108    0.000 decimal.py:825(__repr__)

   This is printing.

>  9884218   25.102    0.000   25.102    0.000 {built-in method match}
> 39536056   20.103    0.000   20.103    0.000 {built-in method group}
>        1   16.522   16.522   16.522   16.522 {method 'execute' of  
> 'psycopg2._psycopg.cursor' objects}
>  9883846    6.461    0.000    6.461    0.000 {method 'lstrip' of 'str'  
> objects}
>  9885976    4.971    0.000    4.971    0.000 {isinstance}

   And some internal stuff.

   Well, fetchall + print spans the entire program, so we can see
sqlbuilder is fast. With this (and with more trust in the profiler) we can
return to analyze SQLObject timing.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            p...@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to