On Sep 28, 2010, at 7:20 PM, Michael Bayer wrote:

> 
> On Sep 28, 2010, at 6:32 PM, kindly wrote:
> 
>> I have been doing some profiling on a batch job I have been running.
>> 
>> I control all my own cascading, so I set the cascade flag on each
>> relation to "none".  Even so mapper.cascade_iterator does quite a lot
>> of work.
>> 
>> I did the crudest test by just placing a return at the top of
>> cascade_iterator.  It speeds up my job by %10-20.  I imagine this
>> would be more if the my relation tree was more complicated.
>> 
>> Do you think this is worth having a mapper option for no cascades?
>> Or detecting there are not any and therefore not pre-emptively
>> recursing the relation tree?
> 
>  The catch of "StopIteration" is certainly a possible bottleneck on this, and 
> we'd have to revisit Ants' refactoring here which originally allowed it to 
> work without recursion.

such as, here's a patch that removes the StopIteration and uses 
deque.popleft().   Can you try it out and see what impact it has ?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Attachment: cascade_iterator_deque.patch
Description: Binary data

Reply via email to