On 6/26/14, 3:07 PM, Hans-Peter Jansen wrote:
> Okay, attached is a profile dump with .commit() out of the way. Here's
> the head of it: --> p = pstats.Stats('srelay.pstats') -->
> p.strip_dirs().sort_stats('cumulative').print_stats(100) Thu Jun 26
> 20:41:50 2014 srelay.pstats 55993702 function calls (54767154
> primitive calls) in 533.479 seconds Ordered by: cumulative time List
> reduced from 1277 to 100 due to restriction <100> ncalls tottime
> percall cumtime percall filename:lineno(function) 1 0.000 0.000
> 533.523 533.523 cProfile.py:146(runcall) 1 0.174 0.174 533.523 533.523
> srelay.py:23(run) 24558 1.060 0.000 458.633 0.019
> srelay.py:74(store_enos_rec) 24586 0.111 0.000 434.802 0.018
> query.py:2280(first) 24586 0.493 0.000 434.687 0.018
> query.py:2143(__getitem__) 24634 0.114 0.000 431.682 0.018
> query.py:2361(__iter__) 24683 1.330 0.000 391.984 0.016
> session.py:1790(flush) 24634 0.052 0.000 391.950 0.016
> session.py:1137(_autoflush) 21043 0.628 0.000 390.597 0.019
> session.py:1841(_flush) 21043 0.396 0.000 385.326 0.018
> unitofwork.py:350(execute) 21043 0.417 0.000 350.813 0.017
> unitofwork.py:299(_generate_actions) 126514 0.814 0.000 348.487 0.003
> unitofwork.py:411(execute) 189809 0.726 0.000 343.341 0.002
> unitofwork.py:177(get_attribute_history) 21108 0.251 0.000 342.547
> 0.016 dependency.py:440(presort_saves) 42240 9.870 0.000 302.804 0.007
> attributes.py:871(get_history) 42160 292.536 0.007 292.910 0.007
> attributes.py:1321(from_collection) 45788 0.175 0.000 55.708 0.001
> base.py:597(execute) 45735 0.410 0.000 53.341 0.001
> base.py:727(_execute_clauseelement) 45788 0.511 0.000 41.410 0.001
> base.py:812(_execute_context) 63209 39.185 0.001 39.294 0.001
> attributes.py:1255(as_state) 2 0.001 0.000 39.039 19.519
> process.py:83(__call__) 39 39.037 1.001 39.037 1.001 {time.sleep}
> 24634 0.157 0.000 36.100 0.001 query.py:2375(_execute_and_instances)
> 45788 0.098 0.000 34.287 0.001 default.py:323(do_execute) 45816 0.490
> 0.000 34.199 0.001 cursors.py:164(execute) 24562 0.513 0.000 32.848
> 0.001 fetch_srelay.py:57(fetch_srelay) 45816 0.083 0.000 32.323 0.001
> cursors.py:353(_query) 45816 0.217 0.000 31.993 0.001
> cursors.py:315(_do_query) 45816 30.949 0.001 30.949 0.001 {method
> 'query' of '_mysql.connection' objects} 198 0.001 0.000 30.394 0.154
> fetch_srelay.py:44(recv) 396 0.003 0.000 30.393 0.077
> fetch_srelay.py:33(recvall) 392 30.039 0.077 30.039 0.077 {method
> 'recv' of '_socket.socket' objects} 63126 0.203 0.000 26.584 0.000
> unitofwork.py:522(execute) Unfortunately, it still suffers from about
> the same runtime behavior. 

> Obviously, some operation triggers the flush method with about the
> same consequences.. 

OK, turn off autoflush - either Session(autoflush=False), or within the
critical block, do "with session.no_autoflush:"

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to