diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-13 16:28:42 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-13 16:28:42 -0400 |
| commit | 5b65af098324a1852c1ca885f5c79b68cd2733c5 (patch) | |
| tree | af153f15531c421d1f035158cfb6943120394ab6 /lib/sqlalchemy/orm/loading.py | |
| parent | 4018a03e7a0b5a84b56e9aca19deca64c1295b59 (diff) | |
| download | sqlalchemy-5b65af098324a1852c1ca885f5c79b68cd2733c5.tar.gz | |
A performance fix related to the usage of the :func:`.defer` option
when loading mapped entities. The function overhead of applying
a per-object deferred callable to an instance at load time was
significantly higher than that of just loading the data from the row
(note that ``defer()`` is meant to reduce DB/network overhead, not
necessarily function call count); the function call overhead is now
less than that of loading data from the column in all cases. There
is also a reduction in the number of "lazy callable" objects created
per load from N (total deferred values in the result) to 1 (total
number of deferred cols).
[ticket:2778]
Diffstat (limited to 'lib/sqlalchemy/orm/loading.py')
| -rw-r--r-- | lib/sqlalchemy/orm/loading.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py index 5937197fd..1006d45c1 100644 --- a/lib/sqlalchemy/orm/loading.py +++ b/lib/sqlalchemy/orm/loading.py @@ -161,7 +161,7 @@ def get_from_identity(session, key, passive): # expired state will be checked soon enough, if necessary return instance try: - state(passive) + state(state, passive) except orm_exc.ObjectDeletedError: session._remove_newly_deleted([state]) return None |
