the method that I improved in my checkin is related to the mapper's
construction of a newly loaded instance, and the test case that
improves 20% focuses most of its time loading a list of 2500 items.
the test you have here spends a lot of time doing lots of other things,
such as saving items (about 60% of its time is spent in save operations
rather than loads), creating new sessions, firing off lazy load
callables, etc.  so its work is too diffuse to illustrate the one
bottleneck i sped up a bit.  if you make your two relations lazy=False,
it knocks a few seconds off the total time.

as far as lifecycle, its dependent on your application's workings.  for
a typical web application its easy - a session for each web request.
for other kinds of apps like GUI apps, you have to identify what
constitutes a "session".  it may or may not be efficient to have a new
session for each transaction.  it depends on how much freshness you
need, what kind of concurrency is present, etc.

there is no option to disable the attribute-copy-on-load operation; you
can make it happen by removing the body of the "commit()" method in
sqlalchemy/orm/attributes.py line 642 and replacing it with just
"pass".  but then your session flushes wont work, and neither will your
test program.  if you created a test program that just did loads, it
still doesnt speed things up too much, particulary if you have few
attributes on your objects.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to