]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
A performance fix related to the usage of the :func:`.defer` option
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Jul 2013 20:28:42 +0000 (16:28 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 13 Jul 2013 20:28:42 +0000 (16:28 -0400)
commit5b65af098324a1852c1ca885f5c79b68cd2733c5
treeaf153f15531c421d1f035158cfb6943120394ab6
parent4018a03e7a0b5a84b56e9aca19deca64c1295b59
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]
doc/build/changelog/changelog_08.rst
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/state.py
lib/sqlalchemy/orm/strategies.py
test/aaa_profiling/test_orm.py
test/orm/test_attributes.py
test/profiles.txt